@valbuild/react 0.28.0 → 0.29.0

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 (28) hide show
  1. package/dist/{ValProvider-4b3dcddd.cjs.prod.js → ValProviderInternal-11c45b39.cjs.prod.js} +8 -31
  2. package/dist/ValProviderInternal-4491e75a.worker.esm.js +17 -0
  3. package/dist/{ValProvider-f27d153f.worker.esm.js → ValProviderInternal-955b2ced.esm.js} +9 -14
  4. package/dist/{ValProvider-7be3721e.cjs.dev.js → ValProviderInternal-f1bbfabb.cjs.dev.js} +8 -31
  5. package/dist/{ValProvider-772ad108.browser.esm.js → ValProviderInternal-fed8d4f2.browser.esm.js} +7 -14
  6. package/dist/{ValUI-a93bea98.worker.esm.js → ValUI-14d84602.worker.esm.js} +9 -6
  7. package/dist/{ValUI-1bebc456.browser.esm.js → ValUI-3aefbfd7.browser.esm.js} +8 -3
  8. package/dist/{ValUI-2dc20794.esm.js → ValUI-8e4092a8.esm.js} +8 -3
  9. package/dist/{ValUI-968a38fb.cjs.dev.js → ValUI-a5ff7b4f.cjs.dev.js} +10 -5
  10. package/dist/ValUI-c636bbdd.cjs.js +7 -0
  11. package/dist/{ValUI-702583bb.cjs.prod.js → ValUI-c636bbdd.cjs.prod.js} +10 -5
  12. package/dist/declarations/src/ValProvider.d.ts +2 -13
  13. package/dist/declarations/src/ValProviderInternal.d.ts +15 -0
  14. package/dist/declarations/src/ValRichText.d.ts +3 -2
  15. package/dist/declarations/src/index.d.ts +2 -1
  16. package/dist/{slicedToArray-4510c35a.worker.esm.js → slicedToArray-5b9980b8.worker.esm.js} +1 -1
  17. package/dist/valbuild-react.browser.esm.js +22 -4
  18. package/dist/valbuild-react.cjs.dev.js +22 -4
  19. package/dist/valbuild-react.cjs.prod.js +22 -4
  20. package/dist/valbuild-react.esm.js +22 -4
  21. package/dist/valbuild-react.worker.esm.js +13 -6
  22. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.worker.esm.js +1 -1
  23. package/jsx-runtime/dist/valbuild-react-jsx-runtime.worker.esm.js +1 -1
  24. package/package.json +3 -3
  25. package/stega/dist/valbuild-react-stega.worker.esm.js +32 -2
  26. package/dist/ValProvider-ecdd4b68.esm.js +0 -618
  27. package/dist/ValUI-702583bb.cjs.js +0 -7
  28. package/dist/defineProperty-18559492.worker.esm.js +0 -32
@@ -2,21 +2,38 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var ValProvider = require('./ValProvider-4b3dcddd.cjs.prod.js');
5
+ var ValProviderInternal$1 = require('./ValProviderInternal-11c45b39.cjs.prod.js');
6
6
  var React = require('react');
7
7
  var ReactJSXRuntime = require('react/jsx-runtime');
8
8
  require('./slicedToArray-1fc98f25.cjs.prod.js');
9
9
  require('./defineProperty-36ed93cd.cjs.prod.js');
10
10
  require('@valbuild/core/fp');
11
11
  require('@valbuild/core');
12
+ require('./ValUI-c636bbdd.cjs.prod.js');
12
13
 
13
14
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
14
15
 
15
16
  var React__default = /*#__PURE__*/_interopDefault(React);
16
17
 
18
+ var ValProviderInternal = typeof window !== "undefined" ? /*#__PURE__*/React.lazy(function () {
19
+ return Promise.resolve().then(function () { return require('./ValProviderInternal-11c45b39.cjs.prod.js'); });
20
+ }) : null;
21
+ function ValProvider(_ref) {
22
+ var children = _ref.children;
23
+ if (ValProviderInternal) {
24
+ return /*#__PURE__*/ReactJSXRuntime.jsx(ValProviderInternal, {
25
+ children: children
26
+ });
27
+ }
28
+ return /*#__PURE__*/ReactJSXRuntime.jsx(ReactJSXRuntime.Fragment, {
29
+ children: children
30
+ });
31
+ }
32
+
17
33
  /* eslint-disable @typescript-eslint/ban-types */
18
34
  function ValRichText(_ref) {
19
35
  var theme = _ref.theme,
36
+ className = _ref.className,
20
37
  children = _ref.children;
21
38
  var root = children;
22
39
  function withRenderTag(clazz, current) {
@@ -148,12 +165,13 @@ function ValRichText(_ref) {
148
165
  });
149
166
  }
150
167
  return /*#__PURE__*/ReactJSXRuntime.jsx("div", {
168
+ className: className,
151
169
  "data-val-path": root.valPath,
152
170
  children: root.children.map(toReact)
153
171
  });
154
172
  }
155
173
 
156
- exports.ValProvider = ValProvider.ValProvider;
157
- exports.useValApi = ValProvider.useValApi;
158
- exports.useValStore = ValProvider.useValStore;
174
+ exports.useValApi = ValProviderInternal$1.useValApi;
175
+ exports.useValStore = ValProviderInternal$1.useValStore;
176
+ exports.ValProvider = ValProvider;
159
177
  exports.ValRichText = ValRichText;
@@ -1,14 +1,31 @@
1
- export { V as ValProvider, a as useValApi, u as useValStore } from './ValProvider-ecdd4b68.esm.js';
2
- import React from 'react';
3
- import { jsx } from 'react/jsx-runtime';
1
+ export { useValApi, useValStore } from './ValProviderInternal-955b2ced.esm.js';
2
+ import React, { lazy } from 'react';
3
+ import { jsx, Fragment } from 'react/jsx-runtime';
4
4
  import './slicedToArray-5418adeb.esm.js';
5
5
  import './defineProperty-b209a901.esm.js';
6
6
  import '@valbuild/core/fp';
7
7
  import '@valbuild/core';
8
+ import './ValUI-8e4092a8.esm.js';
9
+
10
+ var ValProviderInternal = typeof window !== "undefined" ? /*#__PURE__*/lazy(function () {
11
+ return import('./ValProviderInternal-955b2ced.esm.js');
12
+ }) : null;
13
+ function ValProvider(_ref) {
14
+ var children = _ref.children;
15
+ if (ValProviderInternal) {
16
+ return /*#__PURE__*/jsx(ValProviderInternal, {
17
+ children: children
18
+ });
19
+ }
20
+ return /*#__PURE__*/jsx(Fragment, {
21
+ children: children
22
+ });
23
+ }
8
24
 
9
25
  /* eslint-disable @typescript-eslint/ban-types */
10
26
  function ValRichText(_ref) {
11
27
  var theme = _ref.theme,
28
+ className = _ref.className,
12
29
  children = _ref.children;
13
30
  var root = children;
14
31
  function withRenderTag(clazz, current) {
@@ -140,9 +157,10 @@ function ValRichText(_ref) {
140
157
  });
141
158
  }
142
159
  return /*#__PURE__*/jsx("div", {
160
+ className: className,
143
161
  "data-val-path": root.valPath,
144
162
  children: root.children.map(toReact)
145
163
  });
146
164
  }
147
165
 
148
- export { ValRichText };
166
+ export { ValProvider, ValRichText };
@@ -1,14 +1,20 @@
1
- export { V as ValProvider, a as useValApi, u as useValStore } from './ValProvider-f27d153f.worker.esm.js';
1
+ export { a as useValApi, u as useValStore } from './ValProviderInternal-4491e75a.worker.esm.js';
2
2
  import React from 'react';
3
- import { jsx } from 'react/jsx-runtime';
4
- import './slicedToArray-4510c35a.worker.esm.js';
5
- import './defineProperty-18559492.worker.esm.js';
6
- import '@valbuild/core/fp';
3
+ import { jsx, Fragment } from 'react/jsx-runtime';
7
4
  import '@valbuild/core';
5
+ import './ValUI-14d84602.worker.esm.js';
6
+
7
+ function ValProvider(_ref) {
8
+ var children = _ref.children;
9
+ return /*#__PURE__*/jsx(Fragment, {
10
+ children: children
11
+ });
12
+ }
8
13
 
9
14
  /* eslint-disable @typescript-eslint/ban-types */
10
15
  function ValRichText(_ref) {
11
16
  var theme = _ref.theme,
17
+ className = _ref.className,
12
18
  children = _ref.children;
13
19
  var root = children;
14
20
  function withRenderTag(clazz, current) {
@@ -140,9 +146,10 @@ function ValRichText(_ref) {
140
146
  });
141
147
  }
142
148
  return /*#__PURE__*/jsx("div", {
149
+ className: className,
143
150
  "data-val-path": root.valPath,
144
151
  children: root.children.map(toReact)
145
152
  });
146
153
  }
147
154
 
148
- export { ValRichText };
155
+ export { ValProvider, ValRichText };
@@ -1,5 +1,5 @@
1
1
  import { _ as _typeof } from '../../dist/typeof-e0c837cc.worker.esm.js';
2
- import { a as _slicedToArray } from '../../dist/slicedToArray-4510c35a.worker.esm.js';
2
+ import { _ as _slicedToArray } from '../../dist/slicedToArray-5b9980b8.worker.esm.js';
3
3
  import { Internal } from '@valbuild/core';
4
4
  import * as jsxRuntimeDev from 'react/jsx-dev-runtime';
5
5
  export * from 'react/jsx-dev-runtime';
@@ -1,5 +1,5 @@
1
1
  import { _ as _typeof } from '../../dist/typeof-e0c837cc.worker.esm.js';
2
- import { a as _slicedToArray } from '../../dist/slicedToArray-4510c35a.worker.esm.js';
2
+ import { _ as _slicedToArray } from '../../dist/slicedToArray-5b9980b8.worker.esm.js';
3
3
  import { Internal } from '@valbuild/core';
4
4
  import * as ReactJSXRuntime from 'react/jsx-runtime';
5
5
  export * from 'react/jsx-runtime';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/react",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "private": false,
5
5
  "description": "Val - React internal helpers",
6
6
  "sideEffects": false,
@@ -9,8 +9,8 @@
9
9
  "test": "jest"
10
10
  },
11
11
  "dependencies": {
12
- "@valbuild/core": "~0.28.0",
13
- "@valbuild/ui": "~0.28.0",
12
+ "@valbuild/core": "~0.29.0",
13
+ "@valbuild/ui": "~0.29.0",
14
14
  "@vercel/stega": "^0.1.0",
15
15
  "base64-arraybuffer": "^1.0.2",
16
16
  "style-to-object": "^0.4.1"
@@ -1,13 +1,43 @@
1
- import { a as _slicedToArray } from '../../dist/slicedToArray-4510c35a.worker.esm.js';
1
+ import { _ as _slicedToArray } from '../../dist/slicedToArray-5b9980b8.worker.esm.js';
2
2
  import { _ as _typeof } from '../../dist/typeof-e0c837cc.worker.esm.js';
3
3
  import ReactJSXRuntime__default from 'react/jsx-runtime';
4
4
  import jsxRuntimeDev__default from 'react/jsx-dev-runtime';
5
5
  import React from 'react';
6
6
  import { VERCEL_STEGA_REGEX, vercelStegaDecode, vercelStegaSplit, vercelStegaCombine } from '@vercel/stega';
7
- import { a as _defineProperty } from '../../dist/defineProperty-18559492.worker.esm.js';
8
7
  import { Internal, VAL_EXTENSION, FILE_REF_PROP } from '@valbuild/core';
9
8
  import { parseRichTextSource } from '@valbuild/ui';
10
9
 
10
+ function _toPrimitive(input, hint) {
11
+ if (typeof input !== "object" || input === null) return input;
12
+ var prim = input[Symbol.toPrimitive];
13
+ if (prim !== undefined) {
14
+ var res = prim.call(input, hint || "default");
15
+ if (typeof res !== "object") return res;
16
+ throw new TypeError("@@toPrimitive must return a primitive value.");
17
+ }
18
+ return (hint === "string" ? String : Number)(input);
19
+ }
20
+
21
+ function _toPropertyKey(arg) {
22
+ var key = _toPrimitive(arg, "string");
23
+ return typeof key === "symbol" ? key : String(key);
24
+ }
25
+
26
+ function _defineProperty(obj, key, value) {
27
+ key = _toPropertyKey(key);
28
+ if (key in obj) {
29
+ Object.defineProperty(obj, key, {
30
+ value: value,
31
+ enumerable: true,
32
+ configurable: true,
33
+ writable: true
34
+ });
35
+ } else {
36
+ obj[key] = value;
37
+ }
38
+ return obj;
39
+ }
40
+
11
41
  var isIntrinsicElement = function isIntrinsicElement(type) {
12
42
  // TODO: think this is not correct, but good enough for now?
13
43
  return typeof type === "string";