@rsmax/one 1.3.12 → 1.3.14

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.
Files changed (92) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/cjs/components/Modal.d.ts +1 -1
  3. package/cjs/createHostComponent.d.ts +1 -1
  4. package/cjs/createHostComponent.js +2 -2
  5. package/cjs/hostComponents/Button/index.d.ts +2 -2
  6. package/cjs/hostComponents/Button/index.web.d.ts +1 -1
  7. package/cjs/hostComponents/Button/index.web.js +1 -1
  8. package/cjs/hostComponents/Button/props/index.d.ts +2 -2
  9. package/cjs/hostComponents/Form/index.d.ts +2 -2
  10. package/cjs/hostComponents/Form/index.web.d.ts +1 -1
  11. package/cjs/hostComponents/Form/props/index.d.ts +2 -2
  12. package/cjs/hostComponents/Image/index.d.ts +2 -2
  13. package/cjs/hostComponents/Image/index.web.d.ts +1 -1
  14. package/cjs/hostComponents/Image/index.web.js +2 -2
  15. package/cjs/hostComponents/Image/props/index.d.ts +2 -2
  16. package/cjs/hostComponents/Input/index.d.ts +1 -1
  17. package/cjs/hostComponents/Input/index.js +1 -1
  18. package/cjs/hostComponents/Input/index.web.d.ts +1 -1
  19. package/cjs/hostComponents/Input/index.web.js +2 -2
  20. package/cjs/hostComponents/Input/props/index.d.ts +2 -2
  21. package/cjs/hostComponents/Label/index.d.ts +2 -2
  22. package/cjs/hostComponents/Label/index.web.d.ts +1 -1
  23. package/cjs/hostComponents/Label/props.d.ts +1 -1
  24. package/cjs/hostComponents/Navigator/index.d.ts +2 -2
  25. package/cjs/hostComponents/Navigator/index.web.d.ts +1 -1
  26. package/cjs/hostComponents/Navigator/index.web.js +5 -7
  27. package/cjs/hostComponents/Navigator/props/index.d.ts +1 -1
  28. package/cjs/hostComponents/Text/index.d.ts +2 -2
  29. package/cjs/hostComponents/Text/index.web.d.ts +1 -1
  30. package/cjs/hostComponents/Text/index.web.js +1 -1
  31. package/cjs/hostComponents/Text/props/index.d.ts +2 -2
  32. package/cjs/hostComponents/Textarea/index.d.ts +2 -2
  33. package/cjs/hostComponents/Textarea/index.web.d.ts +1 -1
  34. package/cjs/hostComponents/Textarea/index.web.js +1 -1
  35. package/cjs/hostComponents/Textarea/props/index.d.ts +2 -2
  36. package/cjs/hostComponents/View/index.d.ts +2 -2
  37. package/cjs/hostComponents/View/index.web.d.ts +1 -1
  38. package/cjs/hostComponents/View/index.web.js +1 -1
  39. package/cjs/hostComponents/View/props/index.d.ts +2 -2
  40. package/cjs/hostComponents/WebView/index.d.ts +2 -2
  41. package/cjs/hostComponents/WebView/index.web.js +1 -1
  42. package/cjs/useWebPlaceholderStyle/plainStyle/CSSProperty.js +1 -1
  43. package/cjs/useWebPlaceholderStyle/plainStyle/index.d.ts +1 -1
  44. package/cjs/useWebPlaceholderStyle/plainStyle/index.js +5 -7
  45. package/esm/components/Modal.d.ts +1 -1
  46. package/esm/components/Modal.js +1 -1
  47. package/esm/createHostComponent.d.ts +1 -1
  48. package/esm/createHostComponent.js +2 -2
  49. package/esm/hostComponents/Button/index.d.ts +2 -2
  50. package/esm/hostComponents/Button/index.web.d.ts +1 -1
  51. package/esm/hostComponents/Button/index.web.js +1 -1
  52. package/esm/hostComponents/Button/props/index.d.ts +2 -2
  53. package/esm/hostComponents/Form/index.d.ts +2 -2
  54. package/esm/hostComponents/Form/index.web.d.ts +1 -1
  55. package/esm/hostComponents/Form/props/index.d.ts +2 -2
  56. package/esm/hostComponents/Image/index.d.ts +2 -2
  57. package/esm/hostComponents/Image/index.web.d.ts +1 -1
  58. package/esm/hostComponents/Image/index.web.js +2 -2
  59. package/esm/hostComponents/Image/props/index.d.ts +2 -2
  60. package/esm/hostComponents/Input/index.d.ts +1 -1
  61. package/esm/hostComponents/Input/index.js +1 -1
  62. package/esm/hostComponents/Input/index.web.d.ts +1 -1
  63. package/esm/hostComponents/Input/index.web.js +2 -2
  64. package/esm/hostComponents/Input/props/index.d.ts +2 -2
  65. package/esm/hostComponents/Label/index.d.ts +2 -2
  66. package/esm/hostComponents/Label/index.web.d.ts +1 -1
  67. package/esm/hostComponents/Label/props.d.ts +1 -1
  68. package/esm/hostComponents/Navigator/index.d.ts +2 -2
  69. package/esm/hostComponents/Navigator/index.web.d.ts +1 -1
  70. package/esm/hostComponents/Navigator/index.web.js +5 -7
  71. package/esm/hostComponents/Navigator/props/index.d.ts +1 -1
  72. package/esm/hostComponents/Text/index.d.ts +2 -2
  73. package/esm/hostComponents/Text/index.web.d.ts +1 -1
  74. package/esm/hostComponents/Text/index.web.js +1 -1
  75. package/esm/hostComponents/Text/props/index.d.ts +2 -2
  76. package/esm/hostComponents/Textarea/index.d.ts +2 -2
  77. package/esm/hostComponents/Textarea/index.web.d.ts +1 -1
  78. package/esm/hostComponents/Textarea/index.web.js +1 -1
  79. package/esm/hostComponents/Textarea/props/index.d.ts +2 -2
  80. package/esm/hostComponents/View/index.d.ts +2 -2
  81. package/esm/hostComponents/View/index.web.d.ts +1 -1
  82. package/esm/hostComponents/View/index.web.js +1 -1
  83. package/esm/hostComponents/View/props/index.d.ts +2 -2
  84. package/esm/hostComponents/WebView/index.d.ts +2 -2
  85. package/esm/hostComponents/WebView/index.web.js +1 -1
  86. package/esm/useWebPlaceholderStyle/plainStyle/CSSProperty.js +1 -1
  87. package/esm/useWebPlaceholderStyle/plainStyle/index.d.ts +1 -1
  88. package/esm/useWebPlaceholderStyle/plainStyle/index.js +5 -7
  89. package/package.json +21 -21
  90. package/rstest.config.js +6 -0
  91. package/scripts/postbuild.js +2 -2
  92. package/vitest.config.js +0 -7
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.3.14](https://github.com/remaxjs/remax/compare/v1.3.13...v1.3.14) (2025-09-10)
7
+
8
+ **Note:** Version bump only for package @rsmax/one
9
+
10
+ ## [1.3.13](https://github.com/remaxjs/remax/compare/v1.3.12...v1.3.13) (2025-06-16)
11
+
12
+ **Note:** Version bump only for package @rsmax/one
13
+
6
14
  ## [1.3.12](https://github.com/remaxjs/remax/compare/v1.3.11...v1.3.12) (2025-06-08)
7
15
 
8
16
  **Note:** Version bump only for package @rsmax/one
@@ -1,2 +1,2 @@
1
- import * as React from 'react';
1
+ import type * as React from 'react';
2
2
  export default function Modal({ children }: React.PropsWithChildren<Record<string, any>>): any;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { TapEvent, TouchEvent, EventTarget, EventCurrentTarget, ImageLoadEvent, ImageErrorEvent, InputEvent, FormEvent } from './types';
2
+ import type { EventCurrentTarget, EventTarget, FormEvent, ImageErrorEvent, ImageLoadEvent, InputEvent, TapEvent, TouchEvent } from './types';
3
3
  export declare function createTarget(target: any, detail: any): EventTarget;
4
4
  export declare function createCurrentTarget(currentTarget: any): EventCurrentTarget;
5
5
  export declare const createTapEvent: (originalEvent: any) => TapEvent;
@@ -27,9 +27,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.aliasProps = exports.createFormEvent = exports.createInputEvent = exports.createCallback = exports.createImageEvent = exports.createTouchEvent = exports.createTapEvent = exports.createCurrentTarget = exports.createTarget = void 0;
30
- const React = __importStar(require("react"));
31
- const memoize_one_1 = __importDefault(require("memoize-one"));
32
30
  const framework_shared_1 = require("@rsmax/framework-shared");
31
+ const memoize_one_1 = __importDefault(require("memoize-one"));
32
+ const React = __importStar(require("react"));
33
33
  function createTarget(target, detail) {
34
34
  return {
35
35
  id: target.id,
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { TapEvent } from '../../types';
1
+ import type React from 'react';
2
+ import type { TapEvent } from '../../types';
3
3
  export interface ButtonProps extends React.AriaAttributes {
4
4
  readonly dataset?: DOMStringMap;
5
5
  id?: string;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ButtonWebProps } from './props';
2
+ import type { ButtonWebProps } from './props';
3
3
  export type ButtonProps = ButtonWebProps;
4
4
  declare const _default: React.ForwardRefExoticComponent<ButtonWebProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -37,8 +37,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
- const React = __importStar(require("react"));
41
40
  const clsx_1 = __importDefault(require("clsx"));
41
+ const React = __importStar(require("react"));
42
42
  const isPlatformSpecifyProp_1 = require("../../utils/isPlatformSpecifyProp");
43
43
  const useWebTouch_1 = __importDefault(require("../useWebTouch"));
44
44
  const Button = (props, ref) => {
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { TapEvent } from '../../../types';
1
+ import type * as React from 'react';
2
+ import type { TapEvent } from '../../../types';
3
3
  export { default as defaults } from './default';
4
4
  export { default as alias } from './alias';
5
5
  interface CommonProps {
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { FormProps } from './props';
1
+ import type React from 'react';
2
+ import type { FormProps } from './props';
3
3
  export type { FormProps };
4
4
  declare const Form: React.ComponentType<FormProps>;
5
5
  export default Form;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FormWebProps } from './props';
2
+ import type { FormWebProps } from './props';
3
3
  export type FormProps = FormWebProps;
4
4
  declare const _default: React.ForwardRefExoticComponent<FormWebProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { FormEvent } from '../../../types';
1
+ import type * as React from 'react';
2
+ import type { FormEvent } from '../../../types';
3
3
  export { default as defaults } from './default';
4
4
  interface CommonProps {
5
5
  readonly dataset?: DOMStringMap;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import ImageProps from './props';
1
+ import type React from 'react';
2
+ import type ImageProps from './props';
3
3
  export type { ImageProps };
4
4
  declare const Image: React.ComponentType<ImageProps>;
5
5
  export default Image;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ImageWebProps } from './props';
2
+ import type { ImageWebProps } from './props';
3
3
  export type ImageProps = ImageWebProps;
4
4
  declare const _default: React.ForwardRefExoticComponent<ImageWebProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -37,14 +37,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
+ const clsx_1 = __importDefault(require("clsx"));
40
41
  const React = __importStar(require("react"));
41
42
  const isPlatformSpecifyProp_1 = require("../../utils/isPlatformSpecifyProp");
42
43
  const modeStyle_1 = __importDefault(require("./modeStyle"));
43
- const clsx_1 = __importDefault(require("clsx"));
44
44
  const Image = (props, ref) => {
45
45
  const _a = (0, isPlatformSpecifyProp_1.filterProps)(props), { className, src, style, mode = 'scaleToFill', onTap, onLoad, onError } = _a, restProps = __rest(_a, ["className", "src", "style", "mode", "onTap", "onLoad", "onError"]);
46
46
  const isWidthFixMode = mode === 'widthFix';
47
- return (React.createElement("div", Object.assign({}, restProps, { onClick: onTap, className: (0, clsx_1.default)('rsmax-image', className), style: Object.assign(Object.assign(Object.assign({}, modeStyle_1.default[mode]), { backgroundImage: `url(${src})`, backgroundRepeat: `no-repeat` }), style) }),
47
+ return (React.createElement("div", Object.assign({}, restProps, { onClick: onTap, className: (0, clsx_1.default)('rsmax-image', className), style: Object.assign(Object.assign(Object.assign({}, modeStyle_1.default[mode]), { backgroundImage: `url(${src})`, backgroundRepeat: 'no-repeat' }), style) }),
48
48
  React.createElement("img", { src: src, ref: ref, style: {
49
49
  visibility: 'hidden',
50
50
  width: isWidthFixMode ? '100%' : undefined,
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { ImageLoadEvent, ImageErrorEvent, TapEvent, TouchStartEvent } from '../../../types';
1
+ import type * as React from 'react';
2
+ import type { ImageErrorEvent, ImageLoadEvent, TapEvent, TouchStartEvent } from '../../../types';
3
3
  export { default as defaults } from './default';
4
4
  interface CommonProps {
5
5
  readonly dataset?: DOMStringMap;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { InputEvent } from '../../types';
2
+ import type { InputEvent } from '../../types';
3
3
  import type { InputProps } from './props';
4
4
  export type { InputProps };
5
5
  export interface InputState {
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
6
  const memoize_one_1 = __importDefault(require("memoize-one"));
7
+ const react_1 = __importDefault(require("react"));
8
8
  const createHostComponent_1 = require("../../createHostComponent");
9
9
  const alias_1 = __importDefault(require("./props/alias"));
10
10
  const createInputCallback = (0, memoize_one_1.default)(createHostComponent_1.createCallback);
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { InputWebProps } from './props';
2
+ import type { InputWebProps } from './props';
3
3
  export type InputProps = InputWebProps;
4
4
  declare const _default: React.ForwardRefExoticComponent<InputWebProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -37,10 +37,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
+ const clsx_1 = __importDefault(require("clsx"));
40
41
  const React = __importStar(require("react"));
41
- const isPlatformSpecifyProp_1 = require("../../utils/isPlatformSpecifyProp");
42
42
  const useWebPlaceholderStyle_1 = __importDefault(require("../../useWebPlaceholderStyle"));
43
- const clsx_1 = __importDefault(require("clsx"));
43
+ const isPlatformSpecifyProp_1 = require("../../utils/isPlatformSpecifyProp");
44
44
  const Input = (props, ref) => {
45
45
  const _a = (0, isPlatformSpecifyProp_1.filterProps)(props), { password, type, onConfirm, onKeyPress, placeholderStyle, className } = _a, restProps = __rest(_a, ["password", "type", "onConfirm", "onKeyPress", "placeholderStyle", "className"]);
46
46
  const [placeholderStyleClassName] = (0, useWebPlaceholderStyle_1.default)(placeholderStyle);
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { InputEvent } from '../../../types';
1
+ import type * as React from 'react';
2
+ import type { InputEvent } from '../../../types';
3
3
  interface CommonProps {
4
4
  readonly dataset?: DOMStringMap;
5
5
  id?: string;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { LabelProps } from './props';
1
+ import type React from 'react';
2
+ import type { LabelProps } from './props';
3
3
  export type { LabelProps };
4
4
  declare const Label: React.ComponentType<LabelProps>;
5
5
  export default Label;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { LabelProps } from './props';
2
+ import type { LabelProps } from './props';
3
3
  export type { LabelProps };
4
4
  declare const _default: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import type * as React from 'react';
2
2
  export interface LabelProps extends React.AriaAttributes {
3
3
  readonly dataset?: DOMStringMap;
4
4
  id?: string;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { NavigatorProps } from './props';
1
+ import type React from 'react';
2
+ import type { NavigatorProps } from './props';
3
3
  export type { NavigatorProps };
4
4
  declare const Navigator: React.ComponentType<NavigatorProps>;
5
5
  export default Navigator;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { NavigatorProps } from './props';
2
+ import type { NavigatorProps } from './props';
3
3
  export type { NavigatorProps };
4
4
  declare const _default: React.ForwardRefExoticComponent<NavigatorProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -37,25 +37,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
- const React = __importStar(require("react"));
41
- const clsx_1 = __importDefault(require("clsx"));
42
40
  const framework_shared_1 = require("@rsmax/framework-shared");
41
+ const clsx_1 = __importDefault(require("clsx"));
42
+ const React = __importStar(require("react"));
43
43
  const isPlatformSpecifyProp_1 = require("../../utils/isPlatformSpecifyProp");
44
44
  const Navigator = (props, ref) => {
45
45
  const _a = (0, isPlatformSpecifyProp_1.filterProps)(props), { className, url, action, hoverClassName, hoverStartTime, hoverStayTime } = _a, restProps = __rest(_a, ["className", "url", "action", "hoverClassName", "hoverStartTime", "hoverStayTime"]);
46
- const history = framework_shared_1.RuntimeOptions.get('history');
46
+ const navigate = framework_shared_1.RuntimeOptions.get('navigate');
47
47
  function handleTap() {
48
48
  switch (action) {
49
49
  case 'reLaunch':
50
50
  window.location.href = window.location.hostname + url;
51
51
  break;
52
52
  case 'redirect':
53
- history.replace(url);
53
+ navigate.replace(url);
54
54
  break;
55
- case 'navigate':
56
- case 'switchTab':
57
55
  default:
58
- history.push(url);
56
+ navigate.push(url);
59
57
  break;
60
58
  }
61
59
  }
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import type * as React from 'react';
2
2
  export { default as defaults } from './default';
3
3
  export interface NavigatorProps {
4
4
  readonly dataset?: DOMStringMap;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import TextProps from './props';
1
+ import type React from 'react';
2
+ import type TextProps from './props';
3
3
  export type { TextProps };
4
4
  declare const Text: React.ComponentType<TextProps>;
5
5
  export default Text;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { TextWebProps } from './props';
2
+ import type { TextWebProps } from './props';
3
3
  export type TextProps = TextWebProps;
4
4
  declare const _default: React.ForwardRefExoticComponent<TextWebProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -37,8 +37,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
- const React = __importStar(require("react"));
41
40
  const clsx_1 = __importDefault(require("clsx"));
41
+ const React = __importStar(require("react"));
42
42
  const isPlatformSpecifyProp_1 = require("../../utils/isPlatformSpecifyProp");
43
43
  const Text = (props, ref) => {
44
44
  const _a = (0, isPlatformSpecifyProp_1.filterProps)(props), { onTap, onTouchStart, onTouchMove, onTouchEnd, onTouchCancel, className, selectable } = _a, restProps = __rest(_a, ["onTap", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "className", "selectable"]);
@@ -1,5 +1,5 @@
1
- import { TapEvent } from '../../../types';
2
- import React from 'react';
1
+ import type React from 'react';
2
+ import type { TapEvent } from '../../../types';
3
3
  export { default as defaults } from './default';
4
4
  interface CommonProps {
5
5
  readonly dataset?: DOMStringMap;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { InputEvent } from '../../types';
3
- import { TextareaProps } from './props';
2
+ import type { InputEvent } from '../../types';
3
+ import type { TextareaProps } from './props';
4
4
  export type { TextareaProps };
5
5
  export interface TextareaState {
6
6
  value?: string;
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
- import { TextareaWebProps } from './props';
2
+ import type { TextareaWebProps } from './props';
3
3
  declare const _default: React.ForwardRefExoticComponent<TextareaWebProps & React.RefAttributes<any>>;
4
4
  export default _default;
@@ -37,11 +37,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
+ const clsx_1 = __importDefault(require("clsx"));
40
41
  const React = __importStar(require("react"));
41
42
  const react_autosize_textarea_1 = __importDefault(require("react-autosize-textarea"));
42
43
  const useWebPlaceholderStyle_1 = __importDefault(require("../../useWebPlaceholderStyle"));
43
44
  const isPlatformSpecifyProp_1 = require("../../utils/isPlatformSpecifyProp");
44
- const clsx_1 = __importDefault(require("clsx"));
45
45
  const Textarea = (props, ref) => {
46
46
  const _a = (0, isPlatformSpecifyProp_1.filterProps)(props), { onConfirm, onKeyPress, autoHeight, className, placeholderStyle } = _a, restProps = __rest(_a, ["onConfirm", "onKeyPress", "autoHeight", "className", "placeholderStyle"]);
47
47
  const [placeholderStyleClassName] = (0, useWebPlaceholderStyle_1.default)(placeholderStyle);
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { InputEvent } from '../../../types';
1
+ import type React from 'react';
2
+ import type { InputEvent } from '../../../types';
3
3
  export { default as alias } from './alias';
4
4
  interface CommonProps {
5
5
  readonly dataset?: DOMStringMap;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import ViewProps from './props';
1
+ import type React from 'react';
2
+ import type ViewProps from './props';
3
3
  export type { ViewProps };
4
4
  declare const View: React.ComponentType<ViewProps>;
5
5
  export default View;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ViewWebProps } from './props';
2
+ import type { ViewWebProps } from './props';
3
3
  export type ViewProps = ViewWebProps;
4
4
  declare const _default: React.ForwardRefExoticComponent<ViewWebProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -37,8 +37,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
- const React = __importStar(require("react"));
41
40
  const clsx_1 = __importDefault(require("clsx"));
41
+ const React = __importStar(require("react"));
42
42
  const isPlatformSpecifyProp_1 = require("../../utils/isPlatformSpecifyProp");
43
43
  const useWebTouch_1 = __importDefault(require("../useWebTouch"));
44
44
  const View = (props, ref) => {
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { TapEvent, TouchStartEvent, TouchEndEvent, TouchMoveEvent, TouchCancelEvent } from '../../../types';
1
+ import type * as React from 'react';
2
+ import type { TapEvent, TouchCancelEvent, TouchEndEvent, TouchMoveEvent, TouchStartEvent } from '../../../types';
3
3
  export { default as defaults } from './default';
4
4
  interface CommonProps {
5
5
  readonly dataset?: DOMStringMap;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { Event } from '../../types';
1
+ import type React from 'react';
2
+ import type { Event } from '../../types';
3
3
  export interface WebViewProps extends React.AriaAttributes {
4
4
  id?: string;
5
5
  src: string;
@@ -37,9 +37,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
+ const clsx_1 = __importDefault(require("clsx"));
40
41
  const React = __importStar(require("react"));
41
42
  const isPlatformSpecifyProp_1 = require("../../utils/isPlatformSpecifyProp");
42
- const clsx_1 = __importDefault(require("clsx"));
43
43
  const WebView = (props, ref) => {
44
44
  const _a = (0, isPlatformSpecifyProp_1.filterProps)(props), { onMessage } = _a, restProps = __rest(_a, ["onMessage"]);
45
45
  React.useEffect(() => {
@@ -65,7 +65,7 @@ function prefixKey(prefix, key) {
65
65
  */
66
66
  const prefixes = ['Webkit', 'ms', 'Moz', 'O'];
67
67
  for (const prop in exports.isUnitlessNumber) {
68
- prefixes.forEach(function (prefix) {
68
+ prefixes.forEach(prefix => {
69
69
  exports.isUnitlessNumber[prefixKey(prefix, prop)] = exports.isUnitlessNumber[prop];
70
70
  });
71
71
  }
@@ -1,3 +1,3 @@
1
- import { CSSProperties } from 'react';
1
+ import type { CSSProperties } from 'react';
2
2
  declare const plainStyle: (style?: CSSProperties) => string;
3
3
  export default plainStyle;
@@ -1,22 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const CSSProperty_1 = require("./CSSProperty");
4
3
  const framework_shared_1 = require("@rsmax/framework-shared");
4
+ const CSSProperty_1 = require("./CSSProperty");
5
5
  const vendorPrefixes = ['webkit', 'moz', 'ms', 'o'];
6
6
  const transformReactStyleKey = (key) => {
7
7
  // css3 var
8
8
  if (key === null || key === void 0 ? void 0 : key.startsWith('--')) {
9
9
  return key;
10
10
  }
11
- let styleValue = key.replace(/\.?([A-Z]+)/g, function (_x, y) {
12
- return '-' + y.toLowerCase();
13
- });
11
+ let styleValue = key.replace(/\.?([A-Z]+)/g, (_x, y) => `-${y.toLowerCase()}`);
14
12
  // vendor prefix
15
13
  if (styleValue === null || styleValue === void 0 ? void 0 : styleValue.startsWith('-')) {
16
14
  const firstWord = styleValue.split('-').filter(s => s)[0];
17
15
  styleValue = styleValue.replace(/^-/, '');
18
16
  if (vendorPrefixes.find(prefix => prefix === firstWord)) {
19
- styleValue = '-' + styleValue;
17
+ styleValue = `-${styleValue}`;
20
18
  }
21
19
  }
22
20
  return styleValue;
@@ -25,7 +23,7 @@ const transformPx = (value) => {
25
23
  if (typeof value !== 'string') {
26
24
  return value;
27
25
  }
28
- return value.replace(/\b(\d+(\.\d+)?)px\b/g, function (match, x) {
26
+ return value.replace(/\b(\d+(\.\d+)?)px\b/g, (match, x) => {
29
27
  const targetUnit = 'rem';
30
28
  const size = Number(x / 100);
31
29
  return size % 1 === 0 ? size + targetUnit : size.toFixed(2) + targetUnit;
@@ -39,7 +37,7 @@ const plainStyle = (style) => {
39
37
  .reduce((acc, key) => {
40
38
  let value = style[key];
41
39
  if (!Number.isNaN(Number(value)) && !CSSProperty_1.isUnitlessNumber[key]) {
42
- value = value + 'rpx';
40
+ value = `${value}rpx`;
43
41
  }
44
42
  return [...acc, `${transformReactStyleKey(key)}:${framework_shared_1.RuntimeOptions.get('pxToRpx') ? transformPx(value) : value};`];
45
43
  }, [])
@@ -1,2 +1,2 @@
1
- import * as React from 'react';
1
+ import type * as React from 'react';
2
2
  export default function Modal({ children }: React.PropsWithChildren<Record<string, any>>): any;
@@ -1,4 +1,4 @@
1
- import { usePageInstance, createPortal } from '@rsmax/runtime';
1
+ import { createPortal, usePageInstance } from '@rsmax/runtime';
2
2
  export default function Modal({ children }) {
3
3
  const inst = usePageInstance();
4
4
  return createPortal(children, inst.modalContainer);
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { TapEvent, TouchEvent, EventTarget, EventCurrentTarget, ImageLoadEvent, ImageErrorEvent, InputEvent, FormEvent } from './types';
2
+ import type { EventCurrentTarget, EventTarget, FormEvent, ImageErrorEvent, ImageLoadEvent, InputEvent, TapEvent, TouchEvent } from './types';
3
3
  export declare function createTarget(target: any, detail: any): EventTarget;
4
4
  export declare function createCurrentTarget(currentTarget: any): EventCurrentTarget;
5
5
  export declare const createTapEvent: (originalEvent: any) => TapEvent;
@@ -1,6 +1,6 @@
1
- import * as React from 'react';
2
- import memoizeOne from 'memoize-one';
3
1
  import { formatDisplayName } from '@rsmax/framework-shared';
2
+ import memoizeOne from 'memoize-one';
3
+ import * as React from 'react';
4
4
  export function createTarget(target, detail) {
5
5
  return {
6
6
  id: target.id,
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { TapEvent } from '../../types';
1
+ import type React from 'react';
2
+ import type { TapEvent } from '../../types';
3
3
  export interface ButtonProps extends React.AriaAttributes {
4
4
  readonly dataset?: DOMStringMap;
5
5
  id?: string;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ButtonWebProps } from './props';
2
+ import type { ButtonWebProps } from './props';
3
3
  export type ButtonProps = ButtonWebProps;
4
4
  declare const _default: React.ForwardRefExoticComponent<ButtonWebProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -9,8 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as React from 'react';
13
12
  import clsx from 'clsx';
13
+ import * as React from 'react';
14
14
  import { filterProps } from '../../utils/isPlatformSpecifyProp';
15
15
  import useWebTouch from '../useWebTouch';
16
16
  const Button = (props, ref) => {
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { TapEvent } from '../../../types';
1
+ import type * as React from 'react';
2
+ import type { TapEvent } from '../../../types';
3
3
  export { default as defaults } from './default';
4
4
  export { default as alias } from './alias';
5
5
  interface CommonProps {
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { FormProps } from './props';
1
+ import type React from 'react';
2
+ import type { FormProps } from './props';
3
3
  export type { FormProps };
4
4
  declare const Form: React.ComponentType<FormProps>;
5
5
  export default Form;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FormWebProps } from './props';
2
+ import type { FormWebProps } from './props';
3
3
  export type FormProps = FormWebProps;
4
4
  declare const _default: React.ForwardRefExoticComponent<FormWebProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { FormEvent } from '../../../types';
1
+ import type * as React from 'react';
2
+ import type { FormEvent } from '../../../types';
3
3
  export { default as defaults } from './default';
4
4
  interface CommonProps {
5
5
  readonly dataset?: DOMStringMap;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import ImageProps from './props';
1
+ import type React from 'react';
2
+ import type ImageProps from './props';
3
3
  export type { ImageProps };
4
4
  declare const Image: React.ComponentType<ImageProps>;
5
5
  export default Image;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ImageWebProps } from './props';
2
+ import type { ImageWebProps } from './props';
3
3
  export type ImageProps = ImageWebProps;
4
4
  declare const _default: React.ForwardRefExoticComponent<ImageWebProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -9,14 +9,14 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
+ import clsx from 'clsx';
12
13
  import * as React from 'react';
13
14
  import { filterProps } from '../../utils/isPlatformSpecifyProp';
14
15
  import modeStyle from './modeStyle';
15
- import clsx from 'clsx';
16
16
  const Image = (props, ref) => {
17
17
  const _a = filterProps(props), { className, src, style, mode = 'scaleToFill', onTap, onLoad, onError } = _a, restProps = __rest(_a, ["className", "src", "style", "mode", "onTap", "onLoad", "onError"]);
18
18
  const isWidthFixMode = mode === 'widthFix';
19
- return (React.createElement("div", Object.assign({}, restProps, { onClick: onTap, className: clsx('rsmax-image', className), style: Object.assign(Object.assign(Object.assign({}, modeStyle[mode]), { backgroundImage: `url(${src})`, backgroundRepeat: `no-repeat` }), style) }),
19
+ return (React.createElement("div", Object.assign({}, restProps, { onClick: onTap, className: clsx('rsmax-image', className), style: Object.assign(Object.assign(Object.assign({}, modeStyle[mode]), { backgroundImage: `url(${src})`, backgroundRepeat: 'no-repeat' }), style) }),
20
20
  React.createElement("img", { src: src, ref: ref, style: {
21
21
  visibility: 'hidden',
22
22
  width: isWidthFixMode ? '100%' : undefined,
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { ImageLoadEvent, ImageErrorEvent, TapEvent, TouchStartEvent } from '../../../types';
1
+ import type * as React from 'react';
2
+ import type { ImageErrorEvent, ImageLoadEvent, TapEvent, TouchStartEvent } from '../../../types';
3
3
  export { default as defaults } from './default';
4
4
  interface CommonProps {
5
5
  readonly dataset?: DOMStringMap;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { InputEvent } from '../../types';
2
+ import type { InputEvent } from '../../types';
3
3
  import type { InputProps } from './props';
4
4
  export type { InputProps };
5
5
  export interface InputState {
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import memoizeOne from 'memoize-one';
2
+ import React from 'react';
3
3
  import { aliasProps, createCallback, createInputEvent } from '../../createHostComponent';
4
4
  import alias from './props/alias';
5
5
  const createInputCallback = memoizeOne(createCallback);
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { InputWebProps } from './props';
2
+ import type { InputWebProps } from './props';
3
3
  export type InputProps = InputWebProps;
4
4
  declare const _default: React.ForwardRefExoticComponent<InputWebProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -9,10 +9,10 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
+ import clsx from 'clsx';
12
13
  import * as React from 'react';
13
- import { filterProps } from '../../utils/isPlatformSpecifyProp';
14
14
  import useWebPlaceholderStyle from '../../useWebPlaceholderStyle';
15
- import clsx from 'clsx';
15
+ import { filterProps } from '../../utils/isPlatformSpecifyProp';
16
16
  const Input = (props, ref) => {
17
17
  const _a = filterProps(props), { password, type, onConfirm, onKeyPress, placeholderStyle, className } = _a, restProps = __rest(_a, ["password", "type", "onConfirm", "onKeyPress", "placeholderStyle", "className"]);
18
18
  const [placeholderStyleClassName] = useWebPlaceholderStyle(placeholderStyle);
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { InputEvent } from '../../../types';
1
+ import type * as React from 'react';
2
+ import type { InputEvent } from '../../../types';
3
3
  interface CommonProps {
4
4
  readonly dataset?: DOMStringMap;
5
5
  id?: string;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { LabelProps } from './props';
1
+ import type React from 'react';
2
+ import type { LabelProps } from './props';
3
3
  export type { LabelProps };
4
4
  declare const Label: React.ComponentType<LabelProps>;
5
5
  export default Label;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { LabelProps } from './props';
2
+ import type { LabelProps } from './props';
3
3
  export type { LabelProps };
4
4
  declare const _default: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import type * as React from 'react';
2
2
  export interface LabelProps extends React.AriaAttributes {
3
3
  readonly dataset?: DOMStringMap;
4
4
  id?: string;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { NavigatorProps } from './props';
1
+ import type React from 'react';
2
+ import type { NavigatorProps } from './props';
3
3
  export type { NavigatorProps };
4
4
  declare const Navigator: React.ComponentType<NavigatorProps>;
5
5
  export default Navigator;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { NavigatorProps } from './props';
2
+ import type { NavigatorProps } from './props';
3
3
  export type { NavigatorProps };
4
4
  declare const _default: React.ForwardRefExoticComponent<NavigatorProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -9,25 +9,23 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as React from 'react';
13
- import clsx from 'clsx';
14
12
  import { RuntimeOptions } from '@rsmax/framework-shared';
13
+ import clsx from 'clsx';
14
+ import * as React from 'react';
15
15
  import { filterProps } from '../../utils/isPlatformSpecifyProp';
16
16
  const Navigator = (props, ref) => {
17
17
  const _a = filterProps(props), { className, url, action, hoverClassName, hoverStartTime, hoverStayTime } = _a, restProps = __rest(_a, ["className", "url", "action", "hoverClassName", "hoverStartTime", "hoverStayTime"]);
18
- const history = RuntimeOptions.get('history');
18
+ const navigate = RuntimeOptions.get('navigate');
19
19
  function handleTap() {
20
20
  switch (action) {
21
21
  case 'reLaunch':
22
22
  window.location.href = window.location.hostname + url;
23
23
  break;
24
24
  case 'redirect':
25
- history.replace(url);
25
+ navigate.replace(url);
26
26
  break;
27
- case 'navigate':
28
- case 'switchTab':
29
27
  default:
30
- history.push(url);
28
+ navigate.push(url);
31
29
  break;
32
30
  }
33
31
  }
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import type * as React from 'react';
2
2
  export { default as defaults } from './default';
3
3
  export interface NavigatorProps {
4
4
  readonly dataset?: DOMStringMap;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import TextProps from './props';
1
+ import type React from 'react';
2
+ import type TextProps from './props';
3
3
  export type { TextProps };
4
4
  declare const Text: React.ComponentType<TextProps>;
5
5
  export default Text;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { TextWebProps } from './props';
2
+ import type { TextWebProps } from './props';
3
3
  export type TextProps = TextWebProps;
4
4
  declare const _default: React.ForwardRefExoticComponent<TextWebProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -9,8 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as React from 'react';
13
12
  import clsx from 'clsx';
13
+ import * as React from 'react';
14
14
  import { filterProps } from '../../utils/isPlatformSpecifyProp';
15
15
  const Text = (props, ref) => {
16
16
  const _a = filterProps(props), { onTap, onTouchStart, onTouchMove, onTouchEnd, onTouchCancel, className, selectable } = _a, restProps = __rest(_a, ["onTap", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel", "className", "selectable"]);
@@ -1,5 +1,5 @@
1
- import { TapEvent } from '../../../types';
2
- import React from 'react';
1
+ import type React from 'react';
2
+ import type { TapEvent } from '../../../types';
3
3
  export { default as defaults } from './default';
4
4
  interface CommonProps {
5
5
  readonly dataset?: DOMStringMap;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { InputEvent } from '../../types';
3
- import { TextareaProps } from './props';
2
+ import type { InputEvent } from '../../types';
3
+ import type { TextareaProps } from './props';
4
4
  export type { TextareaProps };
5
5
  export interface TextareaState {
6
6
  value?: string;
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
- import { TextareaWebProps } from './props';
2
+ import type { TextareaWebProps } from './props';
3
3
  declare const _default: React.ForwardRefExoticComponent<TextareaWebProps & React.RefAttributes<any>>;
4
4
  export default _default;
@@ -9,11 +9,11 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
+ import clsx from 'clsx';
12
13
  import * as React from 'react';
13
14
  import TextareaAutoSize from 'react-autosize-textarea';
14
15
  import useWebPlaceholderStyle from '../../useWebPlaceholderStyle';
15
16
  import { filterProps } from '../../utils/isPlatformSpecifyProp';
16
- import clsx from 'clsx';
17
17
  const Textarea = (props, ref) => {
18
18
  const _a = filterProps(props), { onConfirm, onKeyPress, autoHeight, className, placeholderStyle } = _a, restProps = __rest(_a, ["onConfirm", "onKeyPress", "autoHeight", "className", "placeholderStyle"]);
19
19
  const [placeholderStyleClassName] = useWebPlaceholderStyle(placeholderStyle);
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { InputEvent } from '../../../types';
1
+ import type React from 'react';
2
+ import type { InputEvent } from '../../../types';
3
3
  export { default as alias } from './alias';
4
4
  interface CommonProps {
5
5
  readonly dataset?: DOMStringMap;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import ViewProps from './props';
1
+ import type React from 'react';
2
+ import type ViewProps from './props';
3
3
  export type { ViewProps };
4
4
  declare const View: React.ComponentType<ViewProps>;
5
5
  export default View;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ViewWebProps } from './props';
2
+ import type { ViewWebProps } from './props';
3
3
  export type ViewProps = ViewWebProps;
4
4
  declare const _default: React.ForwardRefExoticComponent<ViewWebProps & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -9,8 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as React from 'react';
13
12
  import clsx from 'clsx';
13
+ import * as React from 'react';
14
14
  import { filterProps } from '../../utils/isPlatformSpecifyProp';
15
15
  import useWebTouch from '../useWebTouch';
16
16
  const View = (props, ref) => {
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { TapEvent, TouchStartEvent, TouchEndEvent, TouchMoveEvent, TouchCancelEvent } from '../../../types';
1
+ import type * as React from 'react';
2
+ import type { TapEvent, TouchCancelEvent, TouchEndEvent, TouchMoveEvent, TouchStartEvent } from '../../../types';
3
3
  export { default as defaults } from './default';
4
4
  interface CommonProps {
5
5
  readonly dataset?: DOMStringMap;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { Event } from '../../types';
1
+ import type React from 'react';
2
+ import type { Event } from '../../types';
3
3
  export interface WebViewProps extends React.AriaAttributes {
4
4
  id?: string;
5
5
  src: string;
@@ -9,9 +9,9 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
+ import clsx from 'clsx';
12
13
  import * as React from 'react';
13
14
  import { filterProps } from '../../utils/isPlatformSpecifyProp';
14
- import clsx from 'clsx';
15
15
  const WebView = (props, ref) => {
16
16
  const _a = filterProps(props), { onMessage } = _a, restProps = __rest(_a, ["onMessage"]);
17
17
  React.useEffect(() => {
@@ -62,7 +62,7 @@ function prefixKey(prefix, key) {
62
62
  */
63
63
  const prefixes = ['Webkit', 'ms', 'Moz', 'O'];
64
64
  for (const prop in isUnitlessNumber) {
65
- prefixes.forEach(function (prefix) {
65
+ prefixes.forEach(prefix => {
66
66
  isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
67
67
  });
68
68
  }
@@ -1,3 +1,3 @@
1
- import { CSSProperties } from 'react';
1
+ import type { CSSProperties } from 'react';
2
2
  declare const plainStyle: (style?: CSSProperties) => string;
3
3
  export default plainStyle;
@@ -1,20 +1,18 @@
1
- import { isUnitlessNumber } from './CSSProperty';
2
1
  import { RuntimeOptions } from '@rsmax/framework-shared';
2
+ import { isUnitlessNumber } from './CSSProperty';
3
3
  const vendorPrefixes = ['webkit', 'moz', 'ms', 'o'];
4
4
  const transformReactStyleKey = (key) => {
5
5
  // css3 var
6
6
  if (key === null || key === void 0 ? void 0 : key.startsWith('--')) {
7
7
  return key;
8
8
  }
9
- let styleValue = key.replace(/\.?([A-Z]+)/g, function (_x, y) {
10
- return '-' + y.toLowerCase();
11
- });
9
+ let styleValue = key.replace(/\.?([A-Z]+)/g, (_x, y) => `-${y.toLowerCase()}`);
12
10
  // vendor prefix
13
11
  if (styleValue === null || styleValue === void 0 ? void 0 : styleValue.startsWith('-')) {
14
12
  const firstWord = styleValue.split('-').filter(s => s)[0];
15
13
  styleValue = styleValue.replace(/^-/, '');
16
14
  if (vendorPrefixes.find(prefix => prefix === firstWord)) {
17
- styleValue = '-' + styleValue;
15
+ styleValue = `-${styleValue}`;
18
16
  }
19
17
  }
20
18
  return styleValue;
@@ -23,7 +21,7 @@ const transformPx = (value) => {
23
21
  if (typeof value !== 'string') {
24
22
  return value;
25
23
  }
26
- return value.replace(/\b(\d+(\.\d+)?)px\b/g, function (match, x) {
24
+ return value.replace(/\b(\d+(\.\d+)?)px\b/g, (match, x) => {
27
25
  const targetUnit = 'rem';
28
26
  const size = Number(x / 100);
29
27
  return size % 1 === 0 ? size + targetUnit : size.toFixed(2) + targetUnit;
@@ -37,7 +35,7 @@ const plainStyle = (style) => {
37
35
  .reduce((acc, key) => {
38
36
  let value = style[key];
39
37
  if (!Number.isNaN(Number(value)) && !isUnitlessNumber[key]) {
40
- value = value + 'rpx';
38
+ value = `${value}rpx`;
41
39
  }
42
40
  return [...acc, `${transformReactStyleKey(key)}:${RuntimeOptions.get('pxToRpx') ? transformPx(value) : value};`];
43
41
  }, [])
package/package.json CHANGED
@@ -1,23 +1,34 @@
1
1
  {
2
2
  "name": "@rsmax/one",
3
- "version": "1.3.12",
3
+ "version": "1.3.14",
4
4
  "description": "Rsmax 小程序多端方案",
5
+ "repository": "git+https://github.com/remaxjs/remax.git",
6
+ "license": "MIT",
5
7
  "main": "./cjs/index.js",
6
- "esnext": "./esm/index.js",
7
8
  "module": "./esm/index.js",
8
9
  "typings": "./esm/index.d.ts",
9
10
  "scripts": {
10
- "clean": "rimraf cjs esm tsconfig.tsbuildinfo",
11
11
  "prebuild": "npm run clean",
12
12
  "build": "tsc",
13
- "build:cjs": "tsc --module CommonJS --outDir cjs",
14
13
  "postbuild": "node ./scripts/postbuild.js",
15
- "test": "vitest run"
14
+ "build:cjs": "tsc --module CommonJS --outDir cjs",
15
+ "clean": "rimraf cjs esm tsconfig.tsbuildinfo",
16
+ "test": "rstest run"
17
+ },
18
+ "dependencies": {
19
+ "@rsmax/ali": "1.3.14",
20
+ "@rsmax/framework-shared": "1.3.14",
21
+ "@rsmax/redbox-react": "^1.0.3",
22
+ "@rsmax/runtime": "1.3.14",
23
+ "@rsmax/toutiao": "1.3.14",
24
+ "@rsmax/web": "1.3.14",
25
+ "@rsmax/wechat": "1.3.14",
26
+ "clsx": "^2.1.1",
27
+ "memoize-one": "^5.1.1",
28
+ "react-autosize-textarea": "^7.0.0"
16
29
  },
17
- "repository": "git+https://github.com/remaxjs/remax.git",
18
- "license": "MIT",
19
30
  "devDependencies": {
20
- "@rsmax/types": "1.3.12",
31
+ "@rsmax/types": "1.3.14",
21
32
  "@types/react": "^18.3.0",
22
33
  "@types/react-dom": "^18.3.0",
23
34
  "@types/react-test-renderer": "^18.3.0",
@@ -25,20 +36,9 @@
25
36
  "react-dom": "^18.3.0",
26
37
  "react-test-renderer": "^18.3.0"
27
38
  },
28
- "dependencies": {
29
- "@rsmax/ali": "1.3.12",
30
- "@rsmax/framework-shared": "1.3.12",
31
- "@rsmax/redbox-react": "^1.0.3",
32
- "@rsmax/runtime": "1.3.12",
33
- "@rsmax/toutiao": "1.3.12",
34
- "@rsmax/web": "1.3.12",
35
- "@rsmax/wechat": "1.3.12",
36
- "clsx": "^2.1.1",
37
- "memoize-one": "^5.1.1",
38
- "react-autosize-textarea": "^7.0.0"
39
- },
40
39
  "publishConfig": {
41
40
  "access": "public"
42
41
  },
43
- "gitHead": "74826f663163c25ebec0017a0e9d5cacea0ca6fc"
42
+ "esnext": "./esm/index.js",
43
+ "gitHead": "a542ee33a167f862ec9db0f7466a33f1cef31106"
44
44
  }
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from '@rstest/core';
2
+
3
+ export default defineConfig({
4
+ globals: true,
5
+ exclude: ['cjs/', 'esm/', 'node_modules/'],
6
+ });
@@ -1,5 +1,5 @@
1
- const path = require('path');
2
- const fs = require('fs');
1
+ const path = require('node:path');
2
+ const fs = require('node:fs');
3
3
 
4
4
  function copyAssetsInDir(outputRoot, fsPath) {
5
5
  fs.readdirSync(fsPath).forEach(fileName => {
package/vitest.config.js DELETED
@@ -1,7 +0,0 @@
1
- import { defineConfig } from 'vitest/config';
2
-
3
- export default defineConfig({
4
- test: {
5
- globals: true,
6
- },
7
- });