@valbuild/react 0.12.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 (45) hide show
  1. package/.babelrc.json +10 -0
  2. package/CHANGELOG.md +0 -0
  3. package/dist/declarations/src/ValApi.d.ts +12 -0
  4. package/dist/declarations/src/ValProvider.d.ts +15 -0
  5. package/dist/declarations/src/ValRichText.d.ts +5 -0
  6. package/dist/declarations/src/ValStore.d.ts +15 -0
  7. package/dist/declarations/src/hooks/useVal.d.ts +3 -0
  8. package/dist/declarations/src/index.d.ts +3 -0
  9. package/dist/declarations/src/jsx-dev-runtime.d.ts +2 -0
  10. package/dist/declarations/src/jsx-namespace.d.ts +46 -0
  11. package/dist/declarations/src/jsx-runtime.d.ts +1 -0
  12. package/dist/slicedToArray-0ead6329.cjs.dev.js +70 -0
  13. package/dist/slicedToArray-236143cd.browser.esm.js +66 -0
  14. package/dist/slicedToArray-390fde8c.esm.js +66 -0
  15. package/dist/slicedToArray-57b117df.cjs.prod.js +70 -0
  16. package/dist/slicedToArray-bf9b195a.worker.esm.js +66 -0
  17. package/dist/valbuild-react.browser.esm.js +1227 -0
  18. package/dist/valbuild-react.cjs.d.ts +2 -0
  19. package/dist/valbuild-react.cjs.d.ts.map +1 -0
  20. package/dist/valbuild-react.cjs.dev.js +1239 -0
  21. package/dist/valbuild-react.cjs.js +7 -0
  22. package/dist/valbuild-react.cjs.prod.js +1239 -0
  23. package/dist/valbuild-react.esm.js +1227 -0
  24. package/dist/valbuild-react.worker.esm.js +1227 -0
  25. package/jest-environment.mjs +17 -0
  26. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.browser.esm.js +41 -0
  27. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.cjs.d.ts +2 -0
  28. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.cjs.d.ts.map +1 -0
  29. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.cjs.dev.js +70 -0
  30. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.cjs.js +7 -0
  31. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.cjs.prod.js +70 -0
  32. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.esm.js +41 -0
  33. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.worker.esm.js +41 -0
  34. package/jsx-dev-runtime/package.json +8 -0
  35. package/jsx-runtime/dist/valbuild-react-jsx-runtime.browser.esm.js +50 -0
  36. package/jsx-runtime/dist/valbuild-react-jsx-runtime.cjs.d.ts +2 -0
  37. package/jsx-runtime/dist/valbuild-react-jsx-runtime.cjs.d.ts.map +1 -0
  38. package/jsx-runtime/dist/valbuild-react-jsx-runtime.cjs.dev.js +80 -0
  39. package/jsx-runtime/dist/valbuild-react-jsx-runtime.cjs.js +7 -0
  40. package/jsx-runtime/dist/valbuild-react-jsx-runtime.cjs.prod.js +80 -0
  41. package/jsx-runtime/dist/valbuild-react-jsx-runtime.esm.js +50 -0
  42. package/jsx-runtime/dist/valbuild-react-jsx-runtime.worker.esm.js +50 -0
  43. package/jsx-runtime/package.json +8 -0
  44. package/package.json +76 -0
  45. package/tsconfig.json +18 -0
@@ -0,0 +1,17 @@
1
+ import { TestEnvironment as JSDOMEnvironment } from "jest-environment-jsdom";
2
+
3
+ /**
4
+ * JSDOM currently does not support TextEncoder/TextDecoder...
5
+ * @see https://github.com/jsdom/jsdom/issues/2524
6
+ */
7
+ class TestEnvironment extends JSDOMEnvironment {
8
+ async setup() {
9
+ await super.setup();
10
+ if (typeof this.global.TextEncoder === "undefined") {
11
+ this.global.TextEncoder = TextEncoder;
12
+ this.global.TextDecoder = TextDecoder;
13
+ }
14
+ }
15
+ }
16
+
17
+ export default TestEnvironment;
@@ -0,0 +1,41 @@
1
+ import { a as _slicedToArray, b as _typeof } from '../../dist/slicedToArray-236143cd.browser.esm.js';
2
+ import { Internal } from '@valbuild/core';
3
+ import * as ReactJSXRuntimeDev from 'react/jsx-dev-runtime';
4
+ export * from 'react/jsx-dev-runtime';
5
+
6
+ var isIntrinsicElement = function isIntrinsicElement(type) {
7
+ // TODO: think this is not correct, but good enough for now?
8
+ return typeof type === "string";
9
+ };
10
+ var devalProps = function devalProps(type, props) {
11
+ var valSources = [];
12
+ if (isIntrinsicElement(type)) {
13
+ for (var _i = 0, _Object$entries = Object.entries(props); _i < _Object$entries.length; _i++) {
14
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
15
+ key = _Object$entries$_i[0],
16
+ value = _Object$entries$_i[1];
17
+ if (_typeof(value) === "object" && value !== null && "val" in value) {
18
+ var valPath = Internal.getValPath(value);
19
+ if (valPath) {
20
+ valSources.push(valPath);
21
+ if (typeof value.val === "string" || value.val === null) {
22
+ props[key] = value.val;
23
+ } else {
24
+ throw Error("TODO: unhandled value type");
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
30
+ if (valSources.length > 0) {
31
+ props["data-val-path"] = valSources.join(",");
32
+ }
33
+ };
34
+ function jsxDEV(type, props, key, isStaticChildren, source, self) {
35
+ // console.log("jsxDEV", type, props, key, isStaticChildren, source, self);
36
+
37
+ devalProps(type, props);
38
+ return ReactJSXRuntimeDev.jsxDEV(type, props, key, isStaticChildren, source, self);
39
+ }
40
+
41
+ export { jsxDEV };
@@ -0,0 +1,2 @@
1
+ export * from "../../dist/declarations/src/jsx-dev-runtime";
2
+ //# sourceMappingURL=valbuild-react-jsx-dev-runtime.cjs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valbuild-react-jsx-dev-runtime.cjs.d.ts","sourceRoot":"","sources":["../../dist/declarations/src/jsx-dev-runtime.d.ts"],"names":[],"mappings":"AAAA"}
@@ -0,0 +1,70 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var slicedToArray = require('../../dist/slicedToArray-0ead6329.cjs.dev.js');
6
+ var core = require('@valbuild/core');
7
+ var ReactJSXRuntimeDev = require('react/jsx-dev-runtime');
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var ReactJSXRuntimeDev__namespace = /*#__PURE__*/_interopNamespace(ReactJSXRuntimeDev);
28
+
29
+ var isIntrinsicElement = function isIntrinsicElement(type) {
30
+ // TODO: think this is not correct, but good enough for now?
31
+ return typeof type === "string";
32
+ };
33
+ var devalProps = function devalProps(type, props) {
34
+ var valSources = [];
35
+ if (isIntrinsicElement(type)) {
36
+ for (var _i = 0, _Object$entries = Object.entries(props); _i < _Object$entries.length; _i++) {
37
+ var _Object$entries$_i = slicedToArray._slicedToArray(_Object$entries[_i], 2),
38
+ key = _Object$entries$_i[0],
39
+ value = _Object$entries$_i[1];
40
+ if (slicedToArray._typeof(value) === "object" && value !== null && "val" in value) {
41
+ var valPath = core.Internal.getValPath(value);
42
+ if (valPath) {
43
+ valSources.push(valPath);
44
+ if (typeof value.val === "string" || value.val === null) {
45
+ props[key] = value.val;
46
+ } else {
47
+ throw Error("TODO: unhandled value type");
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ if (valSources.length > 0) {
54
+ props["data-val-path"] = valSources.join(",");
55
+ }
56
+ };
57
+ function jsxDEV(type, props, key, isStaticChildren, source, self) {
58
+ // console.log("jsxDEV", type, props, key, isStaticChildren, source, self);
59
+
60
+ devalProps(type, props);
61
+ return ReactJSXRuntimeDev__namespace.jsxDEV(type, props, key, isStaticChildren, source, self);
62
+ }
63
+
64
+ exports.jsxDEV = jsxDEV;
65
+ Object.keys(ReactJSXRuntimeDev).forEach(function (k) {
66
+ if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
67
+ enumerable: true,
68
+ get: function () { return ReactJSXRuntimeDev[k]; }
69
+ });
70
+ });
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./valbuild-react-jsx-dev-runtime.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./valbuild-react-jsx-dev-runtime.cjs.dev.js");
7
+ }
@@ -0,0 +1,70 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var slicedToArray = require('../../dist/slicedToArray-57b117df.cjs.prod.js');
6
+ var core = require('@valbuild/core');
7
+ var ReactJSXRuntimeDev = require('react/jsx-dev-runtime');
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var ReactJSXRuntimeDev__namespace = /*#__PURE__*/_interopNamespace(ReactJSXRuntimeDev);
28
+
29
+ var isIntrinsicElement = function isIntrinsicElement(type) {
30
+ // TODO: think this is not correct, but good enough for now?
31
+ return typeof type === "string";
32
+ };
33
+ var devalProps = function devalProps(type, props) {
34
+ var valSources = [];
35
+ if (isIntrinsicElement(type)) {
36
+ for (var _i = 0, _Object$entries = Object.entries(props); _i < _Object$entries.length; _i++) {
37
+ var _Object$entries$_i = slicedToArray._slicedToArray(_Object$entries[_i], 2),
38
+ key = _Object$entries$_i[0],
39
+ value = _Object$entries$_i[1];
40
+ if (slicedToArray._typeof(value) === "object" && value !== null && "val" in value) {
41
+ var valPath = core.Internal.getValPath(value);
42
+ if (valPath) {
43
+ valSources.push(valPath);
44
+ if (typeof value.val === "string" || value.val === null) {
45
+ props[key] = value.val;
46
+ } else {
47
+ throw Error("TODO: unhandled value type");
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ if (valSources.length > 0) {
54
+ props["data-val-path"] = valSources.join(",");
55
+ }
56
+ };
57
+ function jsxDEV(type, props, key, isStaticChildren, source, self) {
58
+ // console.log("jsxDEV", type, props, key, isStaticChildren, source, self);
59
+
60
+ devalProps(type, props);
61
+ return ReactJSXRuntimeDev__namespace.jsxDEV(type, props, key, isStaticChildren, source, self);
62
+ }
63
+
64
+ exports.jsxDEV = jsxDEV;
65
+ Object.keys(ReactJSXRuntimeDev).forEach(function (k) {
66
+ if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
67
+ enumerable: true,
68
+ get: function () { return ReactJSXRuntimeDev[k]; }
69
+ });
70
+ });
@@ -0,0 +1,41 @@
1
+ import { a as _slicedToArray, b as _typeof } from '../../dist/slicedToArray-390fde8c.esm.js';
2
+ import { Internal } from '@valbuild/core';
3
+ import * as ReactJSXRuntimeDev from 'react/jsx-dev-runtime';
4
+ export * from 'react/jsx-dev-runtime';
5
+
6
+ var isIntrinsicElement = function isIntrinsicElement(type) {
7
+ // TODO: think this is not correct, but good enough for now?
8
+ return typeof type === "string";
9
+ };
10
+ var devalProps = function devalProps(type, props) {
11
+ var valSources = [];
12
+ if (isIntrinsicElement(type)) {
13
+ for (var _i = 0, _Object$entries = Object.entries(props); _i < _Object$entries.length; _i++) {
14
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
15
+ key = _Object$entries$_i[0],
16
+ value = _Object$entries$_i[1];
17
+ if (_typeof(value) === "object" && value !== null && "val" in value) {
18
+ var valPath = Internal.getValPath(value);
19
+ if (valPath) {
20
+ valSources.push(valPath);
21
+ if (typeof value.val === "string" || value.val === null) {
22
+ props[key] = value.val;
23
+ } else {
24
+ throw Error("TODO: unhandled value type");
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
30
+ if (valSources.length > 0) {
31
+ props["data-val-path"] = valSources.join(",");
32
+ }
33
+ };
34
+ function jsxDEV(type, props, key, isStaticChildren, source, self) {
35
+ // console.log("jsxDEV", type, props, key, isStaticChildren, source, self);
36
+
37
+ devalProps(type, props);
38
+ return ReactJSXRuntimeDev.jsxDEV(type, props, key, isStaticChildren, source, self);
39
+ }
40
+
41
+ export { jsxDEV };
@@ -0,0 +1,41 @@
1
+ import { a as _slicedToArray, b as _typeof } from '../../dist/slicedToArray-bf9b195a.worker.esm.js';
2
+ import { Internal } from '@valbuild/core';
3
+ import * as ReactJSXRuntimeDev from 'react/jsx-dev-runtime';
4
+ export * from 'react/jsx-dev-runtime';
5
+
6
+ var isIntrinsicElement = function isIntrinsicElement(type) {
7
+ // TODO: think this is not correct, but good enough for now?
8
+ return typeof type === "string";
9
+ };
10
+ var devalProps = function devalProps(type, props) {
11
+ var valSources = [];
12
+ if (isIntrinsicElement(type)) {
13
+ for (var _i = 0, _Object$entries = Object.entries(props); _i < _Object$entries.length; _i++) {
14
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
15
+ key = _Object$entries$_i[0],
16
+ value = _Object$entries$_i[1];
17
+ if (_typeof(value) === "object" && value !== null && "val" in value) {
18
+ var valPath = Internal.getValPath(value);
19
+ if (valPath) {
20
+ valSources.push(valPath);
21
+ if (typeof value.val === "string" || value.val === null) {
22
+ props[key] = value.val;
23
+ } else {
24
+ throw Error("TODO: unhandled value type");
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
30
+ if (valSources.length > 0) {
31
+ props["data-val-path"] = valSources.join(",");
32
+ }
33
+ };
34
+ function jsxDEV(type, props, key, isStaticChildren, source, self) {
35
+ // console.log("jsxDEV", type, props, key, isStaticChildren, source, self);
36
+
37
+ devalProps(type, props);
38
+ return ReactJSXRuntimeDev.jsxDEV(type, props, key, isStaticChildren, source, self);
39
+ }
40
+
41
+ export { jsxDEV };
@@ -0,0 +1,8 @@
1
+ {
2
+ "main": "dist/valbuild-react-jsx-dev-runtime.cjs.js",
3
+ "module": "dist/valbuild-react-jsx-dev-runtime.esm.js",
4
+ "browser": {
5
+ "./dist/valbuild-react-jsx-dev-runtime.esm.js": "./dist/valbuild-react-jsx-dev-runtime.browser.esm.js"
6
+ },
7
+ "types": "../src/jsx-runtime.dev.d.ts"
8
+ }
@@ -0,0 +1,50 @@
1
+ import { a as _slicedToArray, b as _typeof } from '../../dist/slicedToArray-236143cd.browser.esm.js';
2
+ import { Internal } from '@valbuild/core';
3
+ import * as ReactJSXRuntime from 'react/jsx-runtime';
4
+ export * from 'react/jsx-runtime';
5
+
6
+ var isIntrinsicElement = function isIntrinsicElement(type) {
7
+ // TODO: think this is not correct, but good enough for now?
8
+ return typeof type === "string";
9
+ };
10
+ var devalProps = function devalProps(type, props) {
11
+ var valSources = [];
12
+ if (isIntrinsicElement(type)) {
13
+ for (var _i = 0, _Object$entries = Object.entries(props); _i < _Object$entries.length; _i++) {
14
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
15
+ key = _Object$entries$_i[0],
16
+ value = _Object$entries$_i[1];
17
+ if (_typeof(value) === "object" && value !== null && "val" in value) {
18
+ var valPath = Internal.getValPath(value);
19
+ if (valPath) {
20
+ valSources.push(valPath);
21
+ if (typeof value.val === "string" || value.val === null) {
22
+ props[key] = value.val;
23
+ } else {
24
+ throw Error("TODO: unhandled value type");
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
30
+ if (valSources.length > 0) {
31
+ props["data-val-path"] = valSources.join(",");
32
+ }
33
+ };
34
+ function jsx(type, props, key) {
35
+ // console.log("jsx", type, props, key);
36
+
37
+ devalProps(type, props);
38
+ return ReactJSXRuntime.jsx(type, props, key);
39
+ }
40
+ function jsxs(type, props, key) {
41
+ // console.log("jsxs", type, props, key);
42
+
43
+ if (key === "key") {
44
+ console.log("jsxDEV", type, props, key, self);
45
+ }
46
+ devalProps(type, props);
47
+ return ReactJSXRuntime.jsxs(type, props, key);
48
+ }
49
+
50
+ export { jsx, jsxs };
@@ -0,0 +1,2 @@
1
+ export * from "../../dist/declarations/src/jsx-runtime";
2
+ //# sourceMappingURL=valbuild-react-jsx-runtime.cjs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valbuild-react-jsx-runtime.cjs.d.ts","sourceRoot":"","sources":["../../dist/declarations/src/jsx-runtime.d.ts"],"names":[],"mappings":"AAAA"}
@@ -0,0 +1,80 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var slicedToArray = require('../../dist/slicedToArray-0ead6329.cjs.dev.js');
6
+ var core = require('@valbuild/core');
7
+ var ReactJSXRuntime = require('react/jsx-runtime');
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var ReactJSXRuntime__namespace = /*#__PURE__*/_interopNamespace(ReactJSXRuntime);
28
+
29
+ var isIntrinsicElement = function isIntrinsicElement(type) {
30
+ // TODO: think this is not correct, but good enough for now?
31
+ return typeof type === "string";
32
+ };
33
+ var devalProps = function devalProps(type, props) {
34
+ var valSources = [];
35
+ if (isIntrinsicElement(type)) {
36
+ for (var _i = 0, _Object$entries = Object.entries(props); _i < _Object$entries.length; _i++) {
37
+ var _Object$entries$_i = slicedToArray._slicedToArray(_Object$entries[_i], 2),
38
+ key = _Object$entries$_i[0],
39
+ value = _Object$entries$_i[1];
40
+ if (slicedToArray._typeof(value) === "object" && value !== null && "val" in value) {
41
+ var valPath = core.Internal.getValPath(value);
42
+ if (valPath) {
43
+ valSources.push(valPath);
44
+ if (typeof value.val === "string" || value.val === null) {
45
+ props[key] = value.val;
46
+ } else {
47
+ throw Error("TODO: unhandled value type");
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ if (valSources.length > 0) {
54
+ props["data-val-path"] = valSources.join(",");
55
+ }
56
+ };
57
+ function jsx(type, props, key) {
58
+ // console.log("jsx", type, props, key);
59
+
60
+ devalProps(type, props);
61
+ return ReactJSXRuntime__namespace.jsx(type, props, key);
62
+ }
63
+ function jsxs(type, props, key) {
64
+ // console.log("jsxs", type, props, key);
65
+
66
+ if (key === "key") {
67
+ console.log("jsxDEV", type, props, key, self);
68
+ }
69
+ devalProps(type, props);
70
+ return ReactJSXRuntime__namespace.jsxs(type, props, key);
71
+ }
72
+
73
+ exports.jsx = jsx;
74
+ exports.jsxs = jsxs;
75
+ Object.keys(ReactJSXRuntime).forEach(function (k) {
76
+ if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
77
+ enumerable: true,
78
+ get: function () { return ReactJSXRuntime[k]; }
79
+ });
80
+ });
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./valbuild-react-jsx-runtime.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./valbuild-react-jsx-runtime.cjs.dev.js");
7
+ }
@@ -0,0 +1,80 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var slicedToArray = require('../../dist/slicedToArray-57b117df.cjs.prod.js');
6
+ var core = require('@valbuild/core');
7
+ var ReactJSXRuntime = require('react/jsx-runtime');
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var ReactJSXRuntime__namespace = /*#__PURE__*/_interopNamespace(ReactJSXRuntime);
28
+
29
+ var isIntrinsicElement = function isIntrinsicElement(type) {
30
+ // TODO: think this is not correct, but good enough for now?
31
+ return typeof type === "string";
32
+ };
33
+ var devalProps = function devalProps(type, props) {
34
+ var valSources = [];
35
+ if (isIntrinsicElement(type)) {
36
+ for (var _i = 0, _Object$entries = Object.entries(props); _i < _Object$entries.length; _i++) {
37
+ var _Object$entries$_i = slicedToArray._slicedToArray(_Object$entries[_i], 2),
38
+ key = _Object$entries$_i[0],
39
+ value = _Object$entries$_i[1];
40
+ if (slicedToArray._typeof(value) === "object" && value !== null && "val" in value) {
41
+ var valPath = core.Internal.getValPath(value);
42
+ if (valPath) {
43
+ valSources.push(valPath);
44
+ if (typeof value.val === "string" || value.val === null) {
45
+ props[key] = value.val;
46
+ } else {
47
+ throw Error("TODO: unhandled value type");
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ if (valSources.length > 0) {
54
+ props["data-val-path"] = valSources.join(",");
55
+ }
56
+ };
57
+ function jsx(type, props, key) {
58
+ // console.log("jsx", type, props, key);
59
+
60
+ devalProps(type, props);
61
+ return ReactJSXRuntime__namespace.jsx(type, props, key);
62
+ }
63
+ function jsxs(type, props, key) {
64
+ // console.log("jsxs", type, props, key);
65
+
66
+ if (key === "key") {
67
+ console.log("jsxDEV", type, props, key, self);
68
+ }
69
+ devalProps(type, props);
70
+ return ReactJSXRuntime__namespace.jsxs(type, props, key);
71
+ }
72
+
73
+ exports.jsx = jsx;
74
+ exports.jsxs = jsxs;
75
+ Object.keys(ReactJSXRuntime).forEach(function (k) {
76
+ if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
77
+ enumerable: true,
78
+ get: function () { return ReactJSXRuntime[k]; }
79
+ });
80
+ });
@@ -0,0 +1,50 @@
1
+ import { a as _slicedToArray, b as _typeof } from '../../dist/slicedToArray-390fde8c.esm.js';
2
+ import { Internal } from '@valbuild/core';
3
+ import * as ReactJSXRuntime from 'react/jsx-runtime';
4
+ export * from 'react/jsx-runtime';
5
+
6
+ var isIntrinsicElement = function isIntrinsicElement(type) {
7
+ // TODO: think this is not correct, but good enough for now?
8
+ return typeof type === "string";
9
+ };
10
+ var devalProps = function devalProps(type, props) {
11
+ var valSources = [];
12
+ if (isIntrinsicElement(type)) {
13
+ for (var _i = 0, _Object$entries = Object.entries(props); _i < _Object$entries.length; _i++) {
14
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
15
+ key = _Object$entries$_i[0],
16
+ value = _Object$entries$_i[1];
17
+ if (_typeof(value) === "object" && value !== null && "val" in value) {
18
+ var valPath = Internal.getValPath(value);
19
+ if (valPath) {
20
+ valSources.push(valPath);
21
+ if (typeof value.val === "string" || value.val === null) {
22
+ props[key] = value.val;
23
+ } else {
24
+ throw Error("TODO: unhandled value type");
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
30
+ if (valSources.length > 0) {
31
+ props["data-val-path"] = valSources.join(",");
32
+ }
33
+ };
34
+ function jsx(type, props, key) {
35
+ // console.log("jsx", type, props, key);
36
+
37
+ devalProps(type, props);
38
+ return ReactJSXRuntime.jsx(type, props, key);
39
+ }
40
+ function jsxs(type, props, key) {
41
+ // console.log("jsxs", type, props, key);
42
+
43
+ if (key === "key") {
44
+ console.log("jsxDEV", type, props, key, self);
45
+ }
46
+ devalProps(type, props);
47
+ return ReactJSXRuntime.jsxs(type, props, key);
48
+ }
49
+
50
+ export { jsx, jsxs };
@@ -0,0 +1,50 @@
1
+ import { a as _slicedToArray, b as _typeof } from '../../dist/slicedToArray-bf9b195a.worker.esm.js';
2
+ import { Internal } from '@valbuild/core';
3
+ import * as ReactJSXRuntime from 'react/jsx-runtime';
4
+ export * from 'react/jsx-runtime';
5
+
6
+ var isIntrinsicElement = function isIntrinsicElement(type) {
7
+ // TODO: think this is not correct, but good enough for now?
8
+ return typeof type === "string";
9
+ };
10
+ var devalProps = function devalProps(type, props) {
11
+ var valSources = [];
12
+ if (isIntrinsicElement(type)) {
13
+ for (var _i = 0, _Object$entries = Object.entries(props); _i < _Object$entries.length; _i++) {
14
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
15
+ key = _Object$entries$_i[0],
16
+ value = _Object$entries$_i[1];
17
+ if (_typeof(value) === "object" && value !== null && "val" in value) {
18
+ var valPath = Internal.getValPath(value);
19
+ if (valPath) {
20
+ valSources.push(valPath);
21
+ if (typeof value.val === "string" || value.val === null) {
22
+ props[key] = value.val;
23
+ } else {
24
+ throw Error("TODO: unhandled value type");
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
30
+ if (valSources.length > 0) {
31
+ props["data-val-path"] = valSources.join(",");
32
+ }
33
+ };
34
+ function jsx(type, props, key) {
35
+ // console.log("jsx", type, props, key);
36
+
37
+ devalProps(type, props);
38
+ return ReactJSXRuntime.jsx(type, props, key);
39
+ }
40
+ function jsxs(type, props, key) {
41
+ // console.log("jsxs", type, props, key);
42
+
43
+ if (key === "key") {
44
+ console.log("jsxDEV", type, props, key, self);
45
+ }
46
+ devalProps(type, props);
47
+ return ReactJSXRuntime.jsxs(type, props, key);
48
+ }
49
+
50
+ export { jsx, jsxs };
@@ -0,0 +1,8 @@
1
+ {
2
+ "main": "dist/valbuild-react-jsx-runtime.cjs.js",
3
+ "module": "dist/valbuild-react-jsx-runtime.esm.js",
4
+ "browser": {
5
+ "./dist/valbuild-react-jsx-runtime.esm.js": "./dist/valbuild-react-jsx-runtime.browser.esm.js"
6
+ },
7
+ "types": "../src/jsx-runtime.d.ts"
8
+ }