@valbuild/react 0.28.0 → 0.30.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.
- package/dist/{ValProvider-f27d153f.worker.esm.js → ValProviderInternal-06aa7448.esm.js} +10 -14
- package/dist/ValProviderInternal-172144ad.cjs.js +7 -0
- package/dist/{ValProvider-4b3dcddd.cjs.prod.js → ValProviderInternal-172144ad.cjs.prod.js} +12 -32
- package/dist/{ValProvider-7be3721e.cjs.dev.js → ValProviderInternal-2faf106c.cjs.dev.js} +12 -32
- package/dist/{ValProvider-772ad108.browser.esm.js → ValProviderInternal-4c19d576.browser.esm.js} +10 -16
- package/dist/{ValProvider-ecdd4b68.esm.js → ValProviderInternal-5a5100ab.worker.esm.js} +10 -16
- package/dist/ValUI-46395962.cjs.js +7 -0
- package/dist/{ValUI-702583bb.cjs.prod.js → ValUI-46395962.cjs.prod.js} +10 -8
- package/dist/{ValUI-1bebc456.browser.esm.js → ValUI-697700f4.browser.esm.js} +8 -6
- package/dist/{ValUI-2dc20794.esm.js → ValUI-9a231a97.esm.js} +8 -6
- package/dist/{ValUI-968a38fb.cjs.dev.js → ValUI-ab7ef83f.cjs.dev.js} +10 -8
- package/dist/{ValUI-a93bea98.worker.esm.js → ValUI-b8544437.worker.esm.js} +8 -6
- package/dist/declarations/src/ValProvider.d.ts +2 -13
- package/dist/declarations/src/ValProviderInternal.d.ts +15 -0
- package/dist/declarations/src/ValRichText.d.ts +3 -2
- package/dist/declarations/src/index.d.ts +2 -1
- package/dist/{defineProperty-034d0378.browser.esm.js → defineProperty-12b5bd29.esm.js} +1 -1
- package/dist/{defineProperty-18559492.worker.esm.js → defineProperty-a4bf59bc.worker.esm.js} +1 -1
- package/dist/{defineProperty-b209a901.esm.js → defineProperty-f319cb47.browser.esm.js} +1 -1
- package/dist/{slicedToArray-4510c35a.worker.esm.js → slicedToArray-331bebbb.esm.js} +16 -16
- package/dist/{slicedToArray-5418adeb.esm.js → slicedToArray-85f6bb43.browser.esm.js} +16 -16
- package/dist/{slicedToArray-964e1994.browser.esm.js → slicedToArray-d4c4a4ed.worker.esm.js} +16 -16
- package/dist/valbuild-react.browser.esm.js +21 -8
- package/dist/valbuild-react.cjs.dev.js +45 -8
- package/dist/valbuild-react.cjs.prod.js +45 -8
- package/dist/valbuild-react.esm.js +21 -8
- package/dist/valbuild-react.worker.esm.js +12 -7
- package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.browser.esm.js +1 -1
- package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.cjs.dev.js +1 -1
- package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.cjs.prod.js +1 -1
- package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.esm.js +1 -1
- package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.worker.esm.js +1 -1
- package/jsx-runtime/dist/valbuild-react-jsx-runtime.browser.esm.js +1 -1
- package/jsx-runtime/dist/valbuild-react-jsx-runtime.cjs.dev.js +1 -1
- package/jsx-runtime/dist/valbuild-react-jsx-runtime.cjs.prod.js +1 -1
- package/jsx-runtime/dist/valbuild-react-jsx-runtime.esm.js +1 -1
- package/jsx-runtime/dist/valbuild-react-jsx-runtime.worker.esm.js +1 -1
- package/package.json +3 -3
- package/stega/dist/valbuild-react-stega.browser.esm.js +2 -2
- package/stega/dist/valbuild-react-stega.cjs.dev.js +1 -1
- package/stega/dist/valbuild-react-stega.cjs.prod.js +1 -1
- package/stega/dist/valbuild-react-stega.esm.js +2 -2
- package/stega/dist/valbuild-react-stega.worker.esm.js +2 -2
- package/dist/ValUI-702583bb.cjs.js +0 -7
- package/dist/{slicedToArray-1fc98f25.cjs.prod.js → slicedToArray-a2a426c7.cjs.prod.js} +15 -15
- package/dist/{slicedToArray-fb0bef7d.cjs.dev.js → slicedToArray-a9d0d9cd.cjs.dev.js} +15 -15
@@ -1,9 +1,11 @@
|
|
1
|
+
'use client';
|
1
2
|
import React, { useContext, useMemo } from 'react';
|
2
|
-
import {
|
3
|
-
import {
|
3
|
+
import { a as _unsupportedIterableToArray, _ as _slicedToArray } from './slicedToArray-331bebbb.esm.js';
|
4
|
+
import { a as _toPropertyKey, _ as _defineProperty } from './defineProperty-12b5bd29.esm.js';
|
4
5
|
import { result } from '@valbuild/core/fp';
|
5
6
|
import { ValApi } from '@valbuild/core';
|
6
|
-
import
|
7
|
+
import ValUI from './ValUI-9a231a97.esm.js';
|
8
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
7
9
|
|
8
10
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
9
11
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
@@ -579,7 +581,6 @@ function createSubscriberId(moduleIds) {
|
|
579
581
|
return moduleIds.slice().sort().join("&");
|
580
582
|
}
|
581
583
|
|
582
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
583
584
|
function useValStore() {
|
584
585
|
return useContext(ValContext).valStore;
|
585
586
|
}
|
@@ -587,15 +588,10 @@ function useValApi() {
|
|
587
588
|
return useContext(ValContext).valApi;
|
588
589
|
}
|
589
590
|
var ValContext = /*#__PURE__*/React.createContext({
|
590
|
-
|
591
|
-
|
592
|
-
},
|
593
|
-
get valApi() {
|
594
|
-
throw Error("Val context not found. Ensure components are wrapped by ValProvider!");
|
595
|
-
}
|
591
|
+
valStore: undefined,
|
592
|
+
valApi: undefined
|
596
593
|
});
|
597
|
-
|
598
|
-
function ValProvider(_ref) {
|
594
|
+
function ValProviderInternal(_ref) {
|
599
595
|
var children = _ref.children;
|
600
596
|
var host = "/api/val";
|
601
597
|
var valApi = useMemo(function () {
|
@@ -609,8 +605,8 @@ function ValProvider(_ref) {
|
|
609
605
|
valApi: valApi,
|
610
606
|
valStore: valStore
|
611
607
|
},
|
612
|
-
children: [children, ValUI ]
|
608
|
+
children: [children, /*#__PURE__*/jsx(ValUI, {})]
|
613
609
|
});
|
614
610
|
}
|
615
611
|
|
616
|
-
export {
|
612
|
+
export { ValContext, ValProviderInternal as default, useValApi, useValStore };
|
@@ -1,33 +1,20 @@
|
|
1
|
+
'use client';
|
1
2
|
'use strict';
|
2
3
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
5
|
+
|
3
6
|
var React = require('react');
|
4
|
-
var slicedToArray = require('./slicedToArray-
|
7
|
+
var slicedToArray = require('./slicedToArray-a2a426c7.cjs.prod.js');
|
5
8
|
var defineProperty = require('./defineProperty-36ed93cd.cjs.prod.js');
|
6
9
|
var fp = require('@valbuild/core/fp');
|
7
10
|
var core = require('@valbuild/core');
|
11
|
+
var ValUI = require('./ValUI-46395962.cjs.prod.js');
|
8
12
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
9
13
|
|
10
14
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
11
15
|
|
12
|
-
function _interopNamespace(e) {
|
13
|
-
if (e && e.__esModule) return e;
|
14
|
-
var n = Object.create(null);
|
15
|
-
if (e) {
|
16
|
-
Object.keys(e).forEach(function (k) {
|
17
|
-
if (k !== 'default') {
|
18
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
19
|
-
Object.defineProperty(n, k, d.get ? d : {
|
20
|
-
enumerable: true,
|
21
|
-
get: function () { return e[k]; }
|
22
|
-
});
|
23
|
-
}
|
24
|
-
});
|
25
|
-
}
|
26
|
-
n["default"] = e;
|
27
|
-
return Object.freeze(n);
|
28
|
-
}
|
29
|
-
|
30
16
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
17
|
+
var ValUI__default = /*#__PURE__*/_interopDefault(ValUI);
|
31
18
|
|
32
19
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
33
20
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
@@ -603,7 +590,6 @@ function createSubscriberId(moduleIds) {
|
|
603
590
|
return moduleIds.slice().sort().join("&");
|
604
591
|
}
|
605
592
|
|
606
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
607
593
|
function useValStore() {
|
608
594
|
return React.useContext(ValContext).valStore;
|
609
595
|
}
|
@@ -611,17 +597,10 @@ function useValApi() {
|
|
611
597
|
return React.useContext(ValContext).valApi;
|
612
598
|
}
|
613
599
|
var ValContext = /*#__PURE__*/React__default["default"].createContext({
|
614
|
-
|
615
|
-
|
616
|
-
},
|
617
|
-
get valApi() {
|
618
|
-
throw Error("Val context not found. Ensure components are wrapped by ValProvider!");
|
619
|
-
}
|
600
|
+
valStore: undefined,
|
601
|
+
valApi: undefined
|
620
602
|
});
|
621
|
-
|
622
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('./ValUI-702583bb.cjs.prod.js')); });
|
623
|
-
}) : null;
|
624
|
-
function ValProvider(_ref) {
|
603
|
+
function ValProviderInternal(_ref) {
|
625
604
|
var children = _ref.children;
|
626
605
|
var host = "/api/val";
|
627
606
|
var valApi = React.useMemo(function () {
|
@@ -635,10 +614,11 @@ function ValProvider(_ref) {
|
|
635
614
|
valApi: valApi,
|
636
615
|
valStore: valStore
|
637
616
|
},
|
638
|
-
children: [children,
|
617
|
+
children: [children, /*#__PURE__*/ReactJSXRuntime.jsx(ValUI__default["default"], {})]
|
639
618
|
});
|
640
619
|
}
|
641
620
|
|
642
|
-
exports.
|
621
|
+
exports.ValContext = ValContext;
|
622
|
+
exports["default"] = ValProviderInternal;
|
643
623
|
exports.useValApi = useValApi;
|
644
624
|
exports.useValStore = useValStore;
|
@@ -1,33 +1,20 @@
|
|
1
|
+
'use client';
|
1
2
|
'use strict';
|
2
3
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
5
|
+
|
3
6
|
var React = require('react');
|
4
|
-
var slicedToArray = require('./slicedToArray-
|
7
|
+
var slicedToArray = require('./slicedToArray-a9d0d9cd.cjs.dev.js');
|
5
8
|
var defineProperty = require('./defineProperty-c82a49b0.cjs.dev.js');
|
6
9
|
var fp = require('@valbuild/core/fp');
|
7
10
|
var core = require('@valbuild/core');
|
11
|
+
var ValUI = require('./ValUI-ab7ef83f.cjs.dev.js');
|
8
12
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
9
13
|
|
10
14
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
11
15
|
|
12
|
-
function _interopNamespace(e) {
|
13
|
-
if (e && e.__esModule) return e;
|
14
|
-
var n = Object.create(null);
|
15
|
-
if (e) {
|
16
|
-
Object.keys(e).forEach(function (k) {
|
17
|
-
if (k !== 'default') {
|
18
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
19
|
-
Object.defineProperty(n, k, d.get ? d : {
|
20
|
-
enumerable: true,
|
21
|
-
get: function () { return e[k]; }
|
22
|
-
});
|
23
|
-
}
|
24
|
-
});
|
25
|
-
}
|
26
|
-
n["default"] = e;
|
27
|
-
return Object.freeze(n);
|
28
|
-
}
|
29
|
-
|
30
16
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
17
|
+
var ValUI__default = /*#__PURE__*/_interopDefault(ValUI);
|
31
18
|
|
32
19
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
33
20
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
@@ -603,7 +590,6 @@ function createSubscriberId(moduleIds) {
|
|
603
590
|
return moduleIds.slice().sort().join("&");
|
604
591
|
}
|
605
592
|
|
606
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
607
593
|
function useValStore() {
|
608
594
|
return React.useContext(ValContext).valStore;
|
609
595
|
}
|
@@ -611,17 +597,10 @@ function useValApi() {
|
|
611
597
|
return React.useContext(ValContext).valApi;
|
612
598
|
}
|
613
599
|
var ValContext = /*#__PURE__*/React__default["default"].createContext({
|
614
|
-
|
615
|
-
|
616
|
-
},
|
617
|
-
get valApi() {
|
618
|
-
throw Error("Val context not found. Ensure components are wrapped by ValProvider!");
|
619
|
-
}
|
600
|
+
valStore: undefined,
|
601
|
+
valApi: undefined
|
620
602
|
});
|
621
|
-
|
622
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('./ValUI-968a38fb.cjs.dev.js')); });
|
623
|
-
}) : null;
|
624
|
-
function ValProvider(_ref) {
|
603
|
+
function ValProviderInternal(_ref) {
|
625
604
|
var children = _ref.children;
|
626
605
|
var host = "/api/val";
|
627
606
|
var valApi = React.useMemo(function () {
|
@@ -635,10 +614,11 @@ function ValProvider(_ref) {
|
|
635
614
|
valApi: valApi,
|
636
615
|
valStore: valStore
|
637
616
|
},
|
638
|
-
children: [children,
|
617
|
+
children: [children, /*#__PURE__*/ReactJSXRuntime.jsx(ValUI__default["default"], {})]
|
639
618
|
});
|
640
619
|
}
|
641
620
|
|
642
|
-
exports.
|
621
|
+
exports.ValContext = ValContext;
|
622
|
+
exports["default"] = ValProviderInternal;
|
643
623
|
exports.useValApi = useValApi;
|
644
624
|
exports.useValStore = useValStore;
|
package/dist/{ValProvider-772ad108.browser.esm.js → ValProviderInternal-4c19d576.browser.esm.js}
RENAMED
@@ -1,8 +1,10 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
import {
|
1
|
+
'use client';
|
2
|
+
import React, { useContext, useMemo } from 'react';
|
3
|
+
import { a as _unsupportedIterableToArray, _ as _slicedToArray } from './slicedToArray-85f6bb43.browser.esm.js';
|
4
|
+
import { a as _toPropertyKey, _ as _defineProperty } from './defineProperty-f319cb47.browser.esm.js';
|
4
5
|
import { result } from '@valbuild/core/fp';
|
5
6
|
import { ValApi } from '@valbuild/core';
|
7
|
+
import ValUI from './ValUI-697700f4.browser.esm.js';
|
6
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
7
9
|
|
8
10
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
@@ -579,7 +581,6 @@ function createSubscriberId(moduleIds) {
|
|
579
581
|
return moduleIds.slice().sort().join("&");
|
580
582
|
}
|
581
583
|
|
582
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
583
584
|
function useValStore() {
|
584
585
|
return useContext(ValContext).valStore;
|
585
586
|
}
|
@@ -587,17 +588,10 @@ function useValApi() {
|
|
587
588
|
return useContext(ValContext).valApi;
|
588
589
|
}
|
589
590
|
var ValContext = /*#__PURE__*/React.createContext({
|
590
|
-
|
591
|
-
|
592
|
-
},
|
593
|
-
get valApi() {
|
594
|
-
throw Error("Val context not found. Ensure components are wrapped by ValProvider!");
|
595
|
-
}
|
591
|
+
valStore: undefined,
|
592
|
+
valApi: undefined
|
596
593
|
});
|
597
|
-
|
598
|
-
return import('./ValUI-1bebc456.browser.esm.js');
|
599
|
-
}) ;
|
600
|
-
function ValProvider(_ref) {
|
594
|
+
function ValProviderInternal(_ref) {
|
601
595
|
var children = _ref.children;
|
602
596
|
var host = "/api/val";
|
603
597
|
var valApi = useMemo(function () {
|
@@ -611,8 +605,8 @@ function ValProvider(_ref) {
|
|
611
605
|
valApi: valApi,
|
612
606
|
valStore: valStore
|
613
607
|
},
|
614
|
-
children: [children,
|
608
|
+
children: [children, /*#__PURE__*/jsx(ValUI, {})]
|
615
609
|
});
|
616
610
|
}
|
617
611
|
|
618
|
-
export {
|
612
|
+
export { ValContext, ValProviderInternal as default, useValApi, useValStore };
|
@@ -1,8 +1,10 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
import {
|
1
|
+
'use client';
|
2
|
+
import React, { useContext, useMemo } from 'react';
|
3
|
+
import { a as _unsupportedIterableToArray, _ as _slicedToArray } from './slicedToArray-d4c4a4ed.worker.esm.js';
|
4
|
+
import { a as _toPropertyKey, _ as _defineProperty } from './defineProperty-a4bf59bc.worker.esm.js';
|
4
5
|
import { result } from '@valbuild/core/fp';
|
5
6
|
import { ValApi } from '@valbuild/core';
|
7
|
+
import ValUI from './ValUI-b8544437.worker.esm.js';
|
6
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
7
9
|
|
8
10
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
@@ -579,7 +581,6 @@ function createSubscriberId(moduleIds) {
|
|
579
581
|
return moduleIds.slice().sort().join("&");
|
580
582
|
}
|
581
583
|
|
582
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
583
584
|
function useValStore() {
|
584
585
|
return useContext(ValContext).valStore;
|
585
586
|
}
|
@@ -587,17 +588,10 @@ function useValApi() {
|
|
587
588
|
return useContext(ValContext).valApi;
|
588
589
|
}
|
589
590
|
var ValContext = /*#__PURE__*/React.createContext({
|
590
|
-
|
591
|
-
|
592
|
-
},
|
593
|
-
get valApi() {
|
594
|
-
throw Error("Val context not found. Ensure components are wrapped by ValProvider!");
|
595
|
-
}
|
591
|
+
valStore: undefined,
|
592
|
+
valApi: undefined
|
596
593
|
});
|
597
|
-
|
598
|
-
return import('./ValUI-2dc20794.esm.js');
|
599
|
-
}) : null;
|
600
|
-
function ValProvider(_ref) {
|
594
|
+
function ValProviderInternal(_ref) {
|
601
595
|
var children = _ref.children;
|
602
596
|
var host = "/api/val";
|
603
597
|
var valApi = useMemo(function () {
|
@@ -611,8 +605,8 @@ function ValProvider(_ref) {
|
|
611
605
|
valApi: valApi,
|
612
606
|
valStore: valStore
|
613
607
|
},
|
614
|
-
children: [children,
|
608
|
+
children: [children, /*#__PURE__*/jsx(ValUI, {})]
|
615
609
|
});
|
616
610
|
}
|
617
611
|
|
618
|
-
export {
|
612
|
+
export { ValContext, ValProviderInternal as default, useValApi, useValStore };
|
@@ -3,15 +3,13 @@
|
|
3
3
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
5
5
|
|
6
|
-
var slicedToArray = require('./slicedToArray-
|
6
|
+
var slicedToArray = require('./slicedToArray-a2a426c7.cjs.prod.js');
|
7
7
|
var core = require('@valbuild/core');
|
8
8
|
var ui = require('@valbuild/ui');
|
9
9
|
var React = require('react');
|
10
10
|
var reactDom = require('react-dom');
|
11
11
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
12
|
-
var
|
13
|
-
require('./defineProperty-36ed93cd.cjs.prod.js');
|
14
|
-
require('@valbuild/core/fp');
|
12
|
+
var ValProviderInternal = require('./ValProviderInternal-172144ad.cjs.prod.js');
|
15
13
|
|
16
14
|
function ShadowContent(_ref) {
|
17
15
|
var root = _ref.root,
|
@@ -63,8 +61,8 @@ function ValUI() {
|
|
63
61
|
_useState6 = slicedToArray._slicedToArray(_useState5, 2);
|
64
62
|
_useState6[0];
|
65
63
|
var setDraftMode = _useState6[1]; // TODO: if enabled, but not in draft mode: show something
|
66
|
-
var api =
|
67
|
-
var store =
|
64
|
+
var api = ValProviderInternal.useValApi();
|
65
|
+
var store = ValProviderInternal.useValStore();
|
68
66
|
React.useEffect(function () {
|
69
67
|
setIsClient(true);
|
70
68
|
try {
|
@@ -83,9 +81,13 @@ function ValUI() {
|
|
83
81
|
}
|
84
82
|
}, []);
|
85
83
|
if (isClient && !enabled && "production" === "development") {
|
86
|
-
|
84
|
+
if (!api) {
|
85
|
+
console.warn("Val does not seem to be configured properly! Please check that you have wrapper your root layout (or _app) with the ValProvider.");
|
86
|
+
} else {
|
87
|
+
console.log("Val is disabled. Enable it by going here ".concat(window.origin).concat(api.host, "/enable?redirect_to=").concat(encodeURIComponent(window.location.href), ". NOTE: this message appears because NODE_ENV is set to development."));
|
88
|
+
}
|
87
89
|
}
|
88
|
-
if (!isClient || !enabled) {
|
90
|
+
if (!isClient || !enabled || !store || !api) {
|
89
91
|
return null;
|
90
92
|
}
|
91
93
|
return /*#__PURE__*/ReactJSXRuntime.jsx(ReactJSXRuntime.Fragment, {
|
@@ -1,13 +1,11 @@
|
|
1
1
|
'use client';
|
2
|
-
import {
|
2
|
+
import { _ as _slicedToArray } from './slicedToArray-85f6bb43.browser.esm.js';
|
3
3
|
import { Internal } from '@valbuild/core';
|
4
4
|
import { Style, ValOverlay } from '@valbuild/ui';
|
5
5
|
import { useRef, useState, useLayoutEffect, useEffect } from 'react';
|
6
6
|
import { createPortal } from 'react-dom';
|
7
7
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
8
|
-
import {
|
9
|
-
import './defineProperty-034d0378.browser.esm.js';
|
10
|
-
import '@valbuild/core/fp';
|
8
|
+
import { useValApi, useValStore } from './ValProviderInternal-4c19d576.browser.esm.js';
|
11
9
|
|
12
10
|
function ShadowContent(_ref) {
|
13
11
|
var root = _ref.root,
|
@@ -79,9 +77,13 @@ function ValUI() {
|
|
79
77
|
}
|
80
78
|
}, []);
|
81
79
|
if (isClient && !enabled && process.env.NODE_ENV === "development") {
|
82
|
-
|
80
|
+
if (!api) {
|
81
|
+
console.warn("Val does not seem to be configured properly! Please check that you have wrapper your root layout (or _app) with the ValProvider.");
|
82
|
+
} else {
|
83
|
+
console.log("Val is disabled. Enable it by going here ".concat(window.origin).concat(api.host, "/enable?redirect_to=").concat(encodeURIComponent(window.location.href), ". NOTE: this message appears because NODE_ENV is set to development."));
|
84
|
+
}
|
83
85
|
}
|
84
|
-
if (!isClient || !enabled) {
|
86
|
+
if (!isClient || !enabled || !store || !api) {
|
85
87
|
return null;
|
86
88
|
}
|
87
89
|
return /*#__PURE__*/jsx(Fragment, {
|
@@ -1,13 +1,11 @@
|
|
1
1
|
'use client';
|
2
|
-
import {
|
2
|
+
import { _ as _slicedToArray } from './slicedToArray-331bebbb.esm.js';
|
3
3
|
import { Internal } from '@valbuild/core';
|
4
4
|
import { Style, ValOverlay } from '@valbuild/ui';
|
5
5
|
import { useRef, useState, useLayoutEffect, useEffect } from 'react';
|
6
6
|
import { createPortal } from 'react-dom';
|
7
7
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
8
|
-
import {
|
9
|
-
import './defineProperty-b209a901.esm.js';
|
10
|
-
import '@valbuild/core/fp';
|
8
|
+
import { useValApi, useValStore } from './ValProviderInternal-06aa7448.esm.js';
|
11
9
|
|
12
10
|
function ShadowContent(_ref) {
|
13
11
|
var root = _ref.root,
|
@@ -79,9 +77,13 @@ function ValUI() {
|
|
79
77
|
}
|
80
78
|
}, []);
|
81
79
|
if (isClient && !enabled && process.env.NODE_ENV === "development") {
|
82
|
-
|
80
|
+
if (!api) {
|
81
|
+
console.warn("Val does not seem to be configured properly! Please check that you have wrapper your root layout (or _app) with the ValProvider.");
|
82
|
+
} else {
|
83
|
+
console.log("Val is disabled. Enable it by going here ".concat(window.origin).concat(api.host, "/enable?redirect_to=").concat(encodeURIComponent(window.location.href), ". NOTE: this message appears because NODE_ENV is set to development."));
|
84
|
+
}
|
83
85
|
}
|
84
|
-
if (!isClient || !enabled) {
|
86
|
+
if (!isClient || !enabled || !store || !api) {
|
85
87
|
return null;
|
86
88
|
}
|
87
89
|
return /*#__PURE__*/jsx(Fragment, {
|
@@ -3,15 +3,13 @@
|
|
3
3
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
5
5
|
|
6
|
-
var slicedToArray = require('./slicedToArray-
|
6
|
+
var slicedToArray = require('./slicedToArray-a9d0d9cd.cjs.dev.js');
|
7
7
|
var core = require('@valbuild/core');
|
8
8
|
var ui = require('@valbuild/ui');
|
9
9
|
var React = require('react');
|
10
10
|
var reactDom = require('react-dom');
|
11
11
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
12
|
-
var
|
13
|
-
require('./defineProperty-c82a49b0.cjs.dev.js');
|
14
|
-
require('@valbuild/core/fp');
|
12
|
+
var ValProviderInternal = require('./ValProviderInternal-2faf106c.cjs.dev.js');
|
15
13
|
|
16
14
|
function ShadowContent(_ref) {
|
17
15
|
var root = _ref.root,
|
@@ -63,8 +61,8 @@ function ValUI() {
|
|
63
61
|
_useState6 = slicedToArray._slicedToArray(_useState5, 2);
|
64
62
|
_useState6[0];
|
65
63
|
var setDraftMode = _useState6[1]; // TODO: if enabled, but not in draft mode: show something
|
66
|
-
var api =
|
67
|
-
var store =
|
64
|
+
var api = ValProviderInternal.useValApi();
|
65
|
+
var store = ValProviderInternal.useValStore();
|
68
66
|
React.useEffect(function () {
|
69
67
|
setIsClient(true);
|
70
68
|
try {
|
@@ -83,9 +81,13 @@ function ValUI() {
|
|
83
81
|
}
|
84
82
|
}, []);
|
85
83
|
if (isClient && !enabled && process.env.NODE_ENV === "development") {
|
86
|
-
|
84
|
+
if (!api) {
|
85
|
+
console.warn("Val does not seem to be configured properly! Please check that you have wrapper your root layout (or _app) with the ValProvider.");
|
86
|
+
} else {
|
87
|
+
console.log("Val is disabled. Enable it by going here ".concat(window.origin).concat(api.host, "/enable?redirect_to=").concat(encodeURIComponent(window.location.href), ". NOTE: this message appears because NODE_ENV is set to development."));
|
88
|
+
}
|
87
89
|
}
|
88
|
-
if (!isClient || !enabled) {
|
90
|
+
if (!isClient || !enabled || !store || !api) {
|
89
91
|
return null;
|
90
92
|
}
|
91
93
|
return /*#__PURE__*/ReactJSXRuntime.jsx(ReactJSXRuntime.Fragment, {
|
@@ -1,13 +1,11 @@
|
|
1
1
|
'use client';
|
2
|
-
import {
|
2
|
+
import { _ as _slicedToArray } from './slicedToArray-d4c4a4ed.worker.esm.js';
|
3
3
|
import { Internal } from '@valbuild/core';
|
4
4
|
import { Style, ValOverlay } from '@valbuild/ui';
|
5
5
|
import { useRef, useState, useLayoutEffect, useEffect } from 'react';
|
6
6
|
import { createPortal } from 'react-dom';
|
7
7
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
8
|
-
import {
|
9
|
-
import './defineProperty-18559492.worker.esm.js';
|
10
|
-
import '@valbuild/core/fp';
|
8
|
+
import { useValApi, useValStore } from './ValProviderInternal-5a5100ab.worker.esm.js';
|
11
9
|
|
12
10
|
function ShadowContent(_ref) {
|
13
11
|
var root = _ref.root,
|
@@ -79,9 +77,13 @@ function ValUI() {
|
|
79
77
|
}
|
80
78
|
}, []);
|
81
79
|
if (isClient && !enabled && process.env.NODE_ENV === "development") {
|
82
|
-
|
80
|
+
if (!api) {
|
81
|
+
console.warn("Val does not seem to be configured properly! Please check that you have wrapper your root layout (or _app) with the ValProvider.");
|
82
|
+
} else {
|
83
|
+
console.log("Val is disabled. Enable it by going here ".concat(window.origin).concat(api.host, "/enable?redirect_to=").concat(encodeURIComponent(window.location.href), ". NOTE: this message appears because NODE_ENV is set to development."));
|
84
|
+
}
|
83
85
|
}
|
84
|
-
if (!isClient || !enabled) {
|
86
|
+
if (!isClient || !enabled || !store || !api) {
|
85
87
|
return null;
|
86
88
|
}
|
87
89
|
return /*#__PURE__*/jsx(Fragment, {
|
@@ -1,14 +1,3 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
import { ValApi } from "@valbuild/core";
|
4
|
-
export declare function useValStore(): ValStore;
|
5
|
-
export declare function useValApi(): ValApi;
|
6
|
-
export type ValContext = {
|
7
|
-
readonly valStore: ValStore;
|
8
|
-
readonly valApi: ValApi;
|
9
|
-
};
|
10
|
-
export declare const ValContext: React.Context<ValContext>;
|
11
|
-
export type ValProviderProps = {
|
12
|
-
children?: React.ReactNode;
|
13
|
-
};
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { ValProviderProps } from "./ValProviderInternal.js";
|
14
3
|
export declare function ValProvider({ children }: ValProviderProps): JSX.Element;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { ValStore } from "./ValStore.js";
|
3
|
+
import { ValApi } from "@valbuild/core";
|
4
|
+
export declare function useValStore(): ValStore | undefined;
|
5
|
+
export declare function useValApi(): ValApi | undefined;
|
6
|
+
export type ValContext = {
|
7
|
+
readonly valStore?: ValStore;
|
8
|
+
readonly valApi?: ValApi;
|
9
|
+
};
|
10
|
+
export declare const ValContext: React.Context<ValContext>;
|
11
|
+
export type ValProviderProps = {
|
12
|
+
children?: React.ReactNode;
|
13
|
+
};
|
14
|
+
declare function ValProviderInternal({ children }: ValProviderProps): JSX.Element;
|
15
|
+
export default ValProviderInternal;
|
@@ -14,8 +14,9 @@ type ThemeOptions<O extends RichTextOptions> = {
|
|
14
14
|
[Key in Classes & keyof O as O[Key] extends true ? Key : never]: string;
|
15
15
|
};
|
16
16
|
};
|
17
|
-
export declare function ValRichText<O extends RichTextOptions>({ theme, children, }: {
|
18
|
-
theme
|
17
|
+
export declare function ValRichText<O extends RichTextOptions>({ theme, className, children, }: {
|
18
|
+
theme?: ThemeOptions<O>;
|
19
|
+
className?: string;
|
19
20
|
children: RichText<O>;
|
20
21
|
}): JSX.Element;
|
21
22
|
export {};
|
@@ -1,18 +1,3 @@
|
|
1
|
-
function _arrayLikeToArray(arr, len) {
|
2
|
-
if (len == null || len > arr.length) len = arr.length;
|
3
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
4
|
-
return arr2;
|
5
|
-
}
|
6
|
-
|
7
|
-
function _unsupportedIterableToArray(o, minLen) {
|
8
|
-
if (!o) return;
|
9
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
10
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
11
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
12
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
13
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
14
|
-
}
|
15
|
-
|
16
1
|
function _arrayWithHoles(arr) {
|
17
2
|
if (Array.isArray(arr)) return arr;
|
18
3
|
}
|
@@ -45,6 +30,21 @@ function _iterableToArrayLimit(r, l) {
|
|
45
30
|
}
|
46
31
|
}
|
47
32
|
|
33
|
+
function _arrayLikeToArray(arr, len) {
|
34
|
+
if (len == null || len > arr.length) len = arr.length;
|
35
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
36
|
+
return arr2;
|
37
|
+
}
|
38
|
+
|
39
|
+
function _unsupportedIterableToArray(o, minLen) {
|
40
|
+
if (!o) return;
|
41
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
42
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
43
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
44
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
45
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
46
|
+
}
|
47
|
+
|
48
48
|
function _nonIterableRest() {
|
49
49
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
50
50
|
}
|
@@ -53,4 +53,4 @@ function _slicedToArray(arr, i) {
|
|
53
53
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
54
54
|
}
|
55
55
|
|
56
|
-
export {
|
56
|
+
export { _slicedToArray as _, _unsupportedIterableToArray as a };
|