@valbuild/react 0.32.0 → 0.34.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 (31) hide show
  1. package/dist/{ValProvider-d46ec16a.worker.esm.js → ValProvider-14e23a8d.worker.esm.js} +1 -1
  2. package/dist/{ValProvider-14179159.browser.esm.js → ValProvider-279ac59b.browser.esm.js} +1 -1
  3. package/dist/ValProvider-69842d7d.cjs.js +7 -0
  4. package/dist/{ValProvider-b2e83d12.cjs.prod.js → ValProvider-69842d7d.cjs.prod.js} +1 -1
  5. package/dist/{ValProvider-0620664e.esm.js → ValProvider-857170d0.esm.js} +1 -1
  6. package/dist/{ValProvider-7513c6ec.cjs.dev.js → ValProvider-be7d6bde.cjs.dev.js} +1 -1
  7. package/dist/ValUI-33562b10.cjs.dev.js +1 -1
  8. package/dist/ValUI-3b9f6c17.worker.esm.js +1 -1
  9. package/dist/ValUI-4ba5efea.esm.js +1 -1
  10. package/dist/ValUI-75338157.browser.esm.js +1 -1
  11. package/dist/ValUI-8ea90ec3.cjs.prod.js +1 -1
  12. package/dist/declarations/src/index.d.ts +1 -1
  13. package/dist/declarations/src/internal/ValRichText.d.ts +8 -11
  14. package/dist/declarations/src/internal/ValStore.d.ts +1 -1
  15. package/dist/valbuild-react.browser.esm.js +1 -1
  16. package/dist/valbuild-react.cjs.dev.js +1 -1
  17. package/dist/valbuild-react.cjs.prod.js +1 -1
  18. package/dist/valbuild-react.esm.js +1 -1
  19. package/dist/valbuild-react.worker.esm.js +1 -1
  20. package/internal/dist/valbuild-react-internal.browser.esm.js +3 -3
  21. package/internal/dist/valbuild-react-internal.cjs.dev.js +3 -3
  22. package/internal/dist/valbuild-react-internal.cjs.prod.js +3 -3
  23. package/internal/dist/valbuild-react-internal.esm.js +3 -3
  24. package/internal/dist/valbuild-react-internal.worker.esm.js +3 -3
  25. package/package.json +4 -3
  26. package/stega/dist/valbuild-react-stega.browser.esm.js +1 -1
  27. package/stega/dist/valbuild-react-stega.cjs.dev.js +3 -3
  28. package/stega/dist/valbuild-react-stega.cjs.prod.js +3 -3
  29. package/stega/dist/valbuild-react-stega.esm.js +1 -1
  30. package/stega/dist/valbuild-react-stega.worker.esm.js +1 -1
  31. package/dist/ValProvider-b2e83d12.cjs.js +0 -7
@@ -545,7 +545,7 @@ var ValStore = /*#__PURE__*/function () {
545
545
  _context3.next = 17;
546
546
  break;
547
547
  case 16:
548
- console.error("Val: failed to update modules", data.error.message);
548
+ console.error("Val: failed to update modules", data.error);
549
549
  case 17:
550
550
  case "end":
551
551
  return _context3.stop();
@@ -545,7 +545,7 @@ var ValStore = /*#__PURE__*/function () {
545
545
  _context3.next = 17;
546
546
  break;
547
547
  case 16:
548
- console.error("Val: failed to update modules", data.error.message);
548
+ console.error("Val: failed to update modules", data.error);
549
549
  case 17:
550
550
  case "end":
551
551
  return _context3.stop();
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./ValProvider-69842d7d.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./ValProvider-69842d7d.cjs.dev.js");
7
+ }
@@ -571,7 +571,7 @@ var ValStore = /*#__PURE__*/function () {
571
571
  _context3.next = 17;
572
572
  break;
573
573
  case 16:
574
- console.error("Val: failed to update modules", data.error.message);
574
+ console.error("Val: failed to update modules", data.error);
575
575
  case 17:
576
576
  case "end":
577
577
  return _context3.stop();
@@ -545,7 +545,7 @@ var ValStore = /*#__PURE__*/function () {
545
545
  _context3.next = 17;
546
546
  break;
547
547
  case 16:
548
- console.error("Val: failed to update modules", data.error.message);
548
+ console.error("Val: failed to update modules", data.error);
549
549
  case 17:
550
550
  case "end":
551
551
  return _context3.stop();
@@ -571,7 +571,7 @@ var ValStore = /*#__PURE__*/function () {
571
571
  _context3.next = 17;
572
572
  break;
573
573
  case 16:
574
- console.error("Val: failed to update modules", data.error.message);
574
+ console.error("Val: failed to update modules", data.error);
575
575
  case 17:
576
576
  case "end":
577
577
  return _context3.stop();
@@ -8,7 +8,7 @@ var slicedToArray = require('./slicedToArray-a9d0d9cd.cjs.dev.js');
8
8
  var React = require('react');
9
9
  var reactDom = require('react-dom');
10
10
  var ReactJSXRuntime = require('react/jsx-runtime');
11
- var ValProvider = require('./ValProvider-7513c6ec.cjs.dev.js');
11
+ var ValProvider = require('./ValProvider-be7d6bde.cjs.dev.js');
12
12
 
13
13
  function ShadowContent(_ref) {
14
14
  var root = _ref.root,
@@ -4,7 +4,7 @@ import { _ as _slicedToArray } from './slicedToArray-d4c4a4ed.worker.esm.js';
4
4
  import { useRef, useState, useLayoutEffect } from 'react';
5
5
  import { createPortal } from 'react-dom';
6
6
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
7
- import { useValApi, useValStore } from './ValProvider-d46ec16a.worker.esm.js';
7
+ import { useValApi, useValStore } from './ValProvider-14e23a8d.worker.esm.js';
8
8
 
9
9
  function ShadowContent(_ref) {
10
10
  var root = _ref.root,
@@ -4,7 +4,7 @@ import { _ as _slicedToArray } from './slicedToArray-331bebbb.esm.js';
4
4
  import { useRef, useState, useLayoutEffect } from 'react';
5
5
  import { createPortal } from 'react-dom';
6
6
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
7
- import { useValApi, useValStore } from './ValProvider-0620664e.esm.js';
7
+ import { useValApi, useValStore } from './ValProvider-857170d0.esm.js';
8
8
 
9
9
  function ShadowContent(_ref) {
10
10
  var root = _ref.root,
@@ -4,7 +4,7 @@ import { _ as _slicedToArray } from './slicedToArray-85f6bb43.browser.esm.js';
4
4
  import { useRef, useState, useLayoutEffect } from 'react';
5
5
  import { createPortal } from 'react-dom';
6
6
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
7
- import { useValApi, useValStore } from './ValProvider-14179159.browser.esm.js';
7
+ import { useValApi, useValStore } from './ValProvider-279ac59b.browser.esm.js';
8
8
 
9
9
  function ShadowContent(_ref) {
10
10
  var root = _ref.root,
@@ -8,7 +8,7 @@ var slicedToArray = require('./slicedToArray-a2a426c7.cjs.prod.js');
8
8
  var React = require('react');
9
9
  var reactDom = require('react-dom');
10
10
  var ReactJSXRuntime = require('react/jsx-runtime');
11
- var ValProvider = require('./ValProvider-b2e83d12.cjs.prod.js');
11
+ var ValProvider = require('./ValProvider-69842d7d.cjs.prod.js');
12
12
 
13
13
  function ShadowContent(_ref) {
14
14
  var root = _ref.root,
@@ -2,7 +2,7 @@
2
2
  * Val React **internal** bindings.
3
3
  *
4
4
  * @remarks
5
- * This package includes only internal entry points and is used only by internal packages.
5
+ * This package includes only internal entry points and should only used be used by internal packages.
6
6
  * Use the valbuild package corresponding to your meta-framework instead of this package.
7
7
  *
8
8
  * @packageDocumentation
@@ -2,17 +2,14 @@
2
2
  import { RichText, RichTextOptions } from "@valbuild/core";
3
3
  type Tags = keyof Pick<RichTextOptions, "img" | "ul" | "ol">;
4
4
  type Classes = keyof Pick<RichTextOptions, "bold" | "italic" | "lineThrough">;
5
- type ThemeOptions<O extends RichTextOptions> = {
6
- tags: (O["headings"] extends Array<unknown> ? {
7
- [Key in O["headings"][number]]: string;
8
- } : {}) & {
9
- [Key in Tags & keyof O as O[Key] extends true ? Key extends "ul" | "ol" ? Key | "li" : Key : never]: string;
10
- } & {
11
- p?: string;
12
- };
13
- classes: {
14
- [Key in Classes & keyof O as O[Key] extends true ? Key : never]: string;
15
- };
5
+ type ThemeOptions<O extends RichTextOptions> = (O["headings"] extends Array<unknown> ? {
6
+ [Key in O["headings"][number]]: string;
7
+ } : {}) & {
8
+ [Key in Tags & keyof O as O[Key] extends true ? Key extends "ul" | "ol" ? Key | "li" : Key : never]: string;
9
+ } & {
10
+ p?: string;
11
+ } & {
12
+ [Key in Classes & keyof O as O[Key] extends true ? Key : never]: string;
16
13
  };
17
14
  export declare function ValRichText<O extends RichTextOptions>({ theme, className, children, }: {
18
15
  theme?: ThemeOptions<O>;
@@ -1,5 +1,5 @@
1
1
  import { Json, ModuleId, ValApi } from "@valbuild/core";
2
- import { IValStore } from "@valbuild/ui";
2
+ import type { IValStore } from "@valbuild/ui";
3
3
  export declare class ValStore implements IValStore {
4
4
  private readonly api;
5
5
  private readonly subscribers;
@@ -2,7 +2,7 @@
2
2
  * Val React **internal** bindings.
3
3
  *
4
4
  * @remarks
5
- * This package includes only internal entry points and is used only by internal packages.
5
+ * This package includes only internal entry points and should only used be used by internal packages.
6
6
  * Use the valbuild package corresponding to your meta-framework instead of this package.
7
7
  *
8
8
  * @packageDocumentation
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  * Val React **internal** bindings.
7
7
  *
8
8
  * @remarks
9
- * This package includes only internal entry points and is used only by internal packages.
9
+ * This package includes only internal entry points and should only used be used by internal packages.
10
10
  * Use the valbuild package corresponding to your meta-framework instead of this package.
11
11
  *
12
12
  * @packageDocumentation
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  * Val React **internal** bindings.
7
7
  *
8
8
  * @remarks
9
- * This package includes only internal entry points and is used only by internal packages.
9
+ * This package includes only internal entry points and should only used be used by internal packages.
10
10
  * Use the valbuild package corresponding to your meta-framework instead of this package.
11
11
  *
12
12
  * @packageDocumentation
@@ -2,7 +2,7 @@
2
2
  * Val React **internal** bindings.
3
3
  *
4
4
  * @remarks
5
- * This package includes only internal entry points and is used only by internal packages.
5
+ * This package includes only internal entry points and should only used be used by internal packages.
6
6
  * Use the valbuild package corresponding to your meta-framework instead of this package.
7
7
  *
8
8
  * @packageDocumentation
@@ -2,7 +2,7 @@
2
2
  * Val React **internal** bindings.
3
3
  *
4
4
  * @remarks
5
- * This package includes only internal entry points and is used only by internal packages.
5
+ * This package includes only internal entry points and should only used be used by internal packages.
6
6
  * Use the valbuild package corresponding to your meta-framework instead of this package.
7
7
  *
8
8
  * @packageDocumentation
@@ -1,4 +1,4 @@
1
- export { ValProvider, useValApi, useValStore } from '../../dist/ValProvider-14179159.browser.esm.js';
1
+ export { ValProvider, useValApi, useValStore } from '../../dist/ValProvider-279ac59b.browser.esm.js';
2
2
  import React from 'react';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
@@ -9,7 +9,7 @@ function ValRichText(_ref) {
9
9
  children = _ref.children;
10
10
  var root = children;
11
11
  function withRenderTag(clazz, current) {
12
- var renderClass = theme.tags[clazz];
12
+ var renderClass = theme === null || theme === void 0 ? void 0 : theme[clazz];
13
13
  if (renderClass && current) {
14
14
  return [current, renderClass].join(" ");
15
15
  }
@@ -19,7 +19,7 @@ function ValRichText(_ref) {
19
19
  return current;
20
20
  }
21
21
  function withRenderClass(clazz, current) {
22
- var renderClass = theme.classes[clazz];
22
+ var renderClass = theme === null || theme === void 0 ? void 0 : theme[clazz];
23
23
  if (renderClass && current) {
24
24
  return [current, renderClass].join(" ");
25
25
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var ValProvider = require('../../dist/ValProvider-7513c6ec.cjs.dev.js');
5
+ var ValProvider = require('../../dist/ValProvider-be7d6bde.cjs.dev.js');
6
6
  var React = require('react');
7
7
  var ReactJSXRuntime = require('react/jsx-runtime');
8
8
 
@@ -17,7 +17,7 @@ function ValRichText(_ref) {
17
17
  children = _ref.children;
18
18
  var root = children;
19
19
  function withRenderTag(clazz, current) {
20
- var renderClass = theme.tags[clazz];
20
+ var renderClass = theme === null || theme === void 0 ? void 0 : theme[clazz];
21
21
  if (renderClass && current) {
22
22
  return [current, renderClass].join(" ");
23
23
  }
@@ -27,7 +27,7 @@ function ValRichText(_ref) {
27
27
  return current;
28
28
  }
29
29
  function withRenderClass(clazz, current) {
30
- var renderClass = theme.classes[clazz];
30
+ var renderClass = theme === null || theme === void 0 ? void 0 : theme[clazz];
31
31
  if (renderClass && current) {
32
32
  return [current, renderClass].join(" ");
33
33
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var ValProvider = require('../../dist/ValProvider-b2e83d12.cjs.prod.js');
5
+ var ValProvider = require('../../dist/ValProvider-69842d7d.cjs.prod.js');
6
6
  var React = require('react');
7
7
  var ReactJSXRuntime = require('react/jsx-runtime');
8
8
 
@@ -17,7 +17,7 @@ function ValRichText(_ref) {
17
17
  children = _ref.children;
18
18
  var root = children;
19
19
  function withRenderTag(clazz, current) {
20
- var renderClass = theme.tags[clazz];
20
+ var renderClass = theme === null || theme === void 0 ? void 0 : theme[clazz];
21
21
  if (renderClass && current) {
22
22
  return [current, renderClass].join(" ");
23
23
  }
@@ -27,7 +27,7 @@ function ValRichText(_ref) {
27
27
  return current;
28
28
  }
29
29
  function withRenderClass(clazz, current) {
30
- var renderClass = theme.classes[clazz];
30
+ var renderClass = theme === null || theme === void 0 ? void 0 : theme[clazz];
31
31
  if (renderClass && current) {
32
32
  return [current, renderClass].join(" ");
33
33
  }
@@ -1,4 +1,4 @@
1
- export { ValProvider, useValApi, useValStore } from '../../dist/ValProvider-0620664e.esm.js';
1
+ export { ValProvider, useValApi, useValStore } from '../../dist/ValProvider-857170d0.esm.js';
2
2
  import React from 'react';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
@@ -9,7 +9,7 @@ function ValRichText(_ref) {
9
9
  children = _ref.children;
10
10
  var root = children;
11
11
  function withRenderTag(clazz, current) {
12
- var renderClass = theme.tags[clazz];
12
+ var renderClass = theme === null || theme === void 0 ? void 0 : theme[clazz];
13
13
  if (renderClass && current) {
14
14
  return [current, renderClass].join(" ");
15
15
  }
@@ -19,7 +19,7 @@ function ValRichText(_ref) {
19
19
  return current;
20
20
  }
21
21
  function withRenderClass(clazz, current) {
22
- var renderClass = theme.classes[clazz];
22
+ var renderClass = theme === null || theme === void 0 ? void 0 : theme[clazz];
23
23
  if (renderClass && current) {
24
24
  return [current, renderClass].join(" ");
25
25
  }
@@ -1,4 +1,4 @@
1
- export { ValProvider, useValApi, useValStore } from '../../dist/ValProvider-d46ec16a.worker.esm.js';
1
+ export { ValProvider, useValApi, useValStore } from '../../dist/ValProvider-14e23a8d.worker.esm.js';
2
2
  import React from 'react';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
@@ -9,7 +9,7 @@ function ValRichText(_ref) {
9
9
  children = _ref.children;
10
10
  var root = children;
11
11
  function withRenderTag(clazz, current) {
12
- var renderClass = theme.tags[clazz];
12
+ var renderClass = theme === null || theme === void 0 ? void 0 : theme[clazz];
13
13
  if (renderClass && current) {
14
14
  return [current, renderClass].join(" ");
15
15
  }
@@ -19,7 +19,7 @@ function ValRichText(_ref) {
19
19
  return current;
20
20
  }
21
21
  function withRenderClass(clazz, current) {
22
- var renderClass = theme.classes[clazz];
22
+ var renderClass = theme === null || theme === void 0 ? void 0 : theme[clazz];
23
23
  if (renderClass && current) {
24
24
  return [current, renderClass].join(" ");
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/react",
3
- "version": "0.32.0",
3
+ "version": "0.34.0",
4
4
  "private": false,
5
5
  "description": "Val - React internal helpers",
6
6
  "sideEffects": false,
@@ -9,8 +9,9 @@
9
9
  "test": "jest"
10
10
  },
11
11
  "dependencies": {
12
- "@valbuild/core": "~0.32.0",
13
- "@valbuild/ui": "~0.32.0",
12
+ "@valbuild/core": "~0.34.0",
13
+ "@valbuild/ui": "~0.34.0",
14
+ "@valbuild/shared": "~0.34.0",
14
15
  "@vercel/stega": "^0.1.0",
15
16
  "base64-arraybuffer": "^1.0.2",
16
17
  "style-to-object": "^0.4.1"
@@ -6,7 +6,7 @@ import React from 'react';
6
6
  import { VERCEL_STEGA_REGEX, vercelStegaDecode, vercelStegaSplit, vercelStegaCombine } from '@vercel/stega';
7
7
  import { _ as _defineProperty } from '../../dist/defineProperty-f319cb47.browser.esm.js';
8
8
  import { Internal, VAL_EXTENSION, FILE_REF_PROP } from '@valbuild/core';
9
- import { parseRichTextSource } from '@valbuild/ui';
9
+ import { parseRichTextSource } from '@valbuild/shared/internal';
10
10
 
11
11
  var isIntrinsicElement = function isIntrinsicElement(type) {
12
12
  // TODO: think this is not correct, but good enough for now?
@@ -10,7 +10,7 @@ var React = require('react');
10
10
  var stega = require('@vercel/stega');
11
11
  var defineProperty = require('../../dist/defineProperty-c82a49b0.cjs.dev.js');
12
12
  var core = require('@valbuild/core');
13
- var ui = require('@valbuild/ui');
13
+ var internal = require('@valbuild/shared/internal');
14
14
 
15
15
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
16
16
 
@@ -126,11 +126,11 @@ function stegaEncode(input, opts) {
126
126
  if (core.VAL_EXTENSION in sourceOrSelector) {
127
127
  if (sourceOrSelector[core.VAL_EXTENSION] === "richtext") {
128
128
  if (recOpts !== null && recOpts !== void 0 && recOpts.path) {
129
- return _objectSpread2(_objectSpread2({}, ui.parseRichTextSource(sourceOrSelector)), {}, {
129
+ return _objectSpread2(_objectSpread2({}, internal.parseRichTextSource(sourceOrSelector)), {}, {
130
130
  valPath: recOpts.path
131
131
  });
132
132
  }
133
- return ui.parseRichTextSource(sourceOrSelector);
133
+ return internal.parseRichTextSource(sourceOrSelector);
134
134
  }
135
135
  if (sourceOrSelector[core.VAL_EXTENSION] === "file" && typeof sourceOrSelector[core.FILE_REF_PROP] === "string") {
136
136
  var fileSelector = core.Internal.convertFileSource(sourceOrSelector);
@@ -10,7 +10,7 @@ var React = require('react');
10
10
  var stega = require('@vercel/stega');
11
11
  var defineProperty = require('../../dist/defineProperty-36ed93cd.cjs.prod.js');
12
12
  var core = require('@valbuild/core');
13
- var ui = require('@valbuild/ui');
13
+ var internal = require('@valbuild/shared/internal');
14
14
 
15
15
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
16
16
 
@@ -126,11 +126,11 @@ function stegaEncode(input, opts) {
126
126
  if (core.VAL_EXTENSION in sourceOrSelector) {
127
127
  if (sourceOrSelector[core.VAL_EXTENSION] === "richtext") {
128
128
  if (recOpts !== null && recOpts !== void 0 && recOpts.path) {
129
- return _objectSpread2(_objectSpread2({}, ui.parseRichTextSource(sourceOrSelector)), {}, {
129
+ return _objectSpread2(_objectSpread2({}, internal.parseRichTextSource(sourceOrSelector)), {}, {
130
130
  valPath: recOpts.path
131
131
  });
132
132
  }
133
- return ui.parseRichTextSource(sourceOrSelector);
133
+ return internal.parseRichTextSource(sourceOrSelector);
134
134
  }
135
135
  if (sourceOrSelector[core.VAL_EXTENSION] === "file" && typeof sourceOrSelector[core.FILE_REF_PROP] === "string") {
136
136
  var fileSelector = core.Internal.convertFileSource(sourceOrSelector);
@@ -6,7 +6,7 @@ import React from 'react';
6
6
  import { VERCEL_STEGA_REGEX, vercelStegaDecode, vercelStegaSplit, vercelStegaCombine } from '@vercel/stega';
7
7
  import { _ as _defineProperty } from '../../dist/defineProperty-12b5bd29.esm.js';
8
8
  import { Internal, VAL_EXTENSION, FILE_REF_PROP } from '@valbuild/core';
9
- import { parseRichTextSource } from '@valbuild/ui';
9
+ import { parseRichTextSource } from '@valbuild/shared/internal';
10
10
 
11
11
  var isIntrinsicElement = function isIntrinsicElement(type) {
12
12
  // TODO: think this is not correct, but good enough for now?
@@ -6,7 +6,7 @@ import React from 'react';
6
6
  import { VERCEL_STEGA_REGEX, vercelStegaDecode, vercelStegaSplit, vercelStegaCombine } from '@vercel/stega';
7
7
  import { _ as _defineProperty } from '../../dist/defineProperty-a4bf59bc.worker.esm.js';
8
8
  import { Internal, VAL_EXTENSION, FILE_REF_PROP } from '@valbuild/core';
9
- import { parseRichTextSource } from '@valbuild/ui';
9
+ import { parseRichTextSource } from '@valbuild/shared/internal';
10
10
 
11
11
  var isIntrinsicElement = function isIntrinsicElement(type) {
12
12
  // TODO: think this is not correct, but good enough for now?
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- if (process.env.NODE_ENV === "production") {
4
- module.exports = require("./ValProvider-b2e83d12.cjs.prod.js");
5
- } else {
6
- module.exports = require("./ValProvider-b2e83d12.cjs.dev.js");
7
- }